Skip to content
This repository was archived by the owner on Feb 22, 2024. It is now read-only.

Commit 4914751

Browse files
committed
fix: for localstorage
1 parent bd669cd commit 4914751

File tree

5 files changed

+16
-5
lines changed

5 files changed

+16
-5
lines changed

src/common/lang.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import BotLanding from '../indexPage/react-components/bot-landing';
99

1010
const elements = ['#notification-banner', '#main', '#footer', '#header'];
1111
export const getLanguage = () => {
12-
const queryLang = parseQueryString().l;
12+
const queryLang = parseQueryString().l || 'en';
1313
const checkIsSupported = queryLang in supportedLanguages;
1414
// eslint-disable-next-line camelcase
1515
const un_supported_languages = ['id', 'tr'];
@@ -47,7 +47,7 @@ export const load = () => {
4747
render(<BotLanding />, document.getElementById('bot-landing'));
4848
elements.map(elem => document.querySelector(elem).classList.add('hidden'));
4949
document.getElementById('bot-landing').classList.remove('hidden');
50-
document.getElementById('bot-main').classList.remove('hidden');
50+
document.getElementById('bot-main').classList.add('hidden');
5151
document.location.search = `l=${newLang}`;
5252
$('.barspinner').hide();
5353
} else {
@@ -72,6 +72,7 @@ export const load = () => {
7272
script.src = `${document.location.protocol}//cdn.crowdin.com/jipt/jipt.js`;
7373
$('body').append(script);
7474
}
75+
console.log(lang, 'dnashjdnajksdnajksdnakjsdnksajnkjs');
7576

7677
init(lang);
7778

src/common/utils/tools.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ export const parseQueryString = () => {
1010
str.replace(new RegExp('([^?=&]+)(=([^&]*))?', 'g'), (a0, a1, a2, a3) => {
1111
objURL[a1] = a3;
1212
});
13-
return objURL;
13+
14+
return objURL || false;
1415
};
1516
export const generateURL = url => {
1617
if (url.split('?').length !== null && url.split('?').length !== undefined) {

src/indexPage/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ export const renderBanner = () => {
8181
getComponent();
8282
render(Component, document.getElementById(dynamicRoutePathanme));
8383
document.getElementById(dynamicRoutePathanme).classList.remove('hidden');
84-
document.getElementById('bot-main').classList.remove('hidden');
8584
document.getElementById('topbar').classList.remove('hidden');
8685
$('.barspinner').hide();
8786
}
@@ -97,11 +96,13 @@ const renderElements = () => {
9796
if (!bannerToken) {
9897
if (window.location.pathname.indexOf('/bot') === -1) {
9998
renderBanner();
99+
document.getElementById('bot-main').classList.add('hidden');
100100
}
101101
} else {
102102
if (today > bannerToken) {
103103
remove('setDueDateForBanner');
104104
renderBanner();
105+
document.getElementById('bot-main').classList.add('hidden');
105106
return false;
106107
}
107108
if (window.location.pathname.indexOf('/bot') === -1) {
@@ -115,6 +116,7 @@ const renderElements = () => {
115116
);
116117
document.getElementById(dynamicRoutePathanme).classList.add('hidden');
117118
}
119+
118120
setTimeout(() => {
119121
$('.barspinner').hide();
120122
}, 2000);
@@ -144,6 +146,7 @@ const loginCheck = () => {
144146
} else {
145147
setTimeout(() => {
146148
renderBanner();
149+
document.getElementById('bot-main').classList.add('hidden');
147150
}, 0);
148151
}
149152
};

static/css/bot.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,14 @@ body {
2929
max-width: 100%;
3030
max-height: 100%;
3131
font-size: 1em;
32+
}
33+
34+
#bot-main{
3235
background: $hero-BG url(../image/BG-1.webp) no-repeat !important;
3336
background-size: cover !important;
37+
position: absolute;
38+
height: 100%;
39+
z-index: -1;
3440
}
3541

3642
#server-status .online {

templates/index.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
</head>
1717

1818
<body>
19-
<div id="bot-main" class="hidden" style="width: 100%; position: relative;">
19+
<div id="bot-main" style="width: 100%; position: relative;">
2020
{{> ../templates/partials/loading }}
2121
</div>
2222
<div id="topbar">

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy