Skip to content

Commit

Permalink
chore: update debug logs on few components;
Browse files Browse the repository at this point in the history
  • Loading branch information
migbash committed Aug 4, 2023
1 parent 5adc310 commit cd94ca6
Show file tree
Hide file tree
Showing 5 changed files with 90 additions and 56 deletions.
12 changes: 8 additions & 4 deletions src/lib/components/_main_/footer/Footer.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ COMPONENT JS (w/ TS)
import sessionStore from '$lib/store/session.js';
import { dlog, FT_W_STY, FT_W_TAG, FT_W_TOG } from '$lib/utils/debug';
import { dlog, FT_W_TAG } from '$lib/utils/debug';
import { viewport_change } from '$lib/utils/platform-functions';
import type { B_FOT_T } from '@betarena/scores-lib/types/footer.js';
Expand Down Expand Up @@ -64,10 +64,14 @@ COMPONENT JS (w/ TS)
*/
async function submitEmail
(
)
): Promise < void >
{
dlog(`${FT_W_TAG} subscribing to email newsletter!`, FT_W_TOG, FT_W_STY);
// [ℹ] showEmailForm = true; // FIXME: ?
// [🐞]
dlog
(
`${FT_W_TAG[0]} subscribing to email newsletter!`
);
$sessionStore.newsletterPopUpShow = true;
}
Expand Down
57 changes: 29 additions & 28 deletions src/lib/components/_main_/header/Header-C-Lang.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ COMPONENT JS (w/ TS)
import sessionStore from "$lib/store/session.js";
import userBetarenaSettings from '$lib/store/user-settings.js';
import { NB_W_STY, NB_W_TAG, dlog, dlogv2 } from "$lib/utils/debug.js";
import { NB_W_TAG, dlog, dlogv2 } from "$lib/utils/debug.js";
import { ROUTE_ID_PROFILE } from "$lib/utils/user.js";
import arrow_down from './assets/arrow-down.svg';
Expand Down Expand Up @@ -84,9 +84,7 @@ COMPONENT JS (w/ TS)
// [🐞]
dlog
(
`${NB_W_TAG} clearning timer!`,
true,
NB_W_STY
`${NB_W_TAG[0]} clearning timer!`,
);
// ➫ NOTE:
Expand All @@ -100,9 +98,7 @@ COMPONENT JS (w/ TS)
// [🐞]
dlog
(
`${NB_W_TAG} setting new timer!`,
true,
NB_W_STY
`${NB_W_TAG[0]} setting new timer!`
);
// ➫ NOTE:
Expand All @@ -114,9 +110,7 @@ COMPONENT JS (w/ TS)
// [🐞]
dlog
(
`${NB_W_TAG} intent triggered!`,
true,
NB_W_STY
`${NB_W_TAG[0]} intent triggered!`
);
$sessionStore.lang_intent = intent_intent_lang;
},
Expand All @@ -133,9 +127,7 @@ COMPONENT JS (w/ TS)
// [🐞]
dlog
(
`${NB_W_TAG} intent triggered!`,
true,
NB_W_STY
`${NB_W_TAG[0]} intent triggered!`
);
$sessionStore.lang_intent = intent_intent_lang;
},
Expand Down Expand Up @@ -180,7 +172,7 @@ COMPONENT JS (w/ TS)
// [🐞]
dlogv2
(
`${NB_W_TAG} selectLanguage()`,
`${NB_W_TAG[0]} selectLanguage()`,
[
`$userBetarenaSettings.lang: ${$userBetarenaSettings.lang}`,
`$sessionStore?.serverLang: ${$sessionStore?.serverLang}`,
Expand All @@ -189,7 +181,7 @@ COMPONENT JS (w/ TS)
`$page.route.id: ${$page.route.id}`
],
true,
NB_W_STY
NB_W_TAG[2]
);
isLangDropdown = false;
Expand Down Expand Up @@ -221,9 +213,7 @@ COMPONENT JS (w/ TS)
// [🐞]
dlog
(
`${NB_W_TAG} -> ${lang}`,
true,
NB_W_STY
`${NB_W_TAG[0]} -> ${lang}`
);
await goto
Expand All @@ -245,9 +235,7 @@ COMPONENT JS (w/ TS)
// [🐞]
dlog
(
`${NB_W_TAG} omitting route: ${$page.route.id}`,
true,
NB_W_STY
`${NB_W_TAG[0]} omitting route: ${$page.route.id}`
);
return;
}
Expand Down Expand Up @@ -275,10 +263,8 @@ COMPONENT JS (w/ TS)
// [🐞]
dlog
(
`${NB_W_TAG} inside (PROFILE) ${lang},
pastLangV2: ${pastLangV2}; tempUrl: ${tempUrl}; newURL: ${newURL}`,
true,
NB_W_STY
`${NB_W_TAG[0]} inside (PROFILE) ${lang},
pastLangV2: ${pastLangV2}; tempUrl: ${tempUrl}; newURL: ${newURL}`
);
await goto
Expand Down Expand Up @@ -310,7 +296,12 @@ COMPONENT JS (w/ TS)
? $page.url.pathname.replace(pastLang, '/')
: $page.url.pathname.replace(pastLang, '')
;
dlog(`${NB_W_TAG} inside (EN) ${lang}, pastLang: ${pastLang}, countSlash: ${countSlash}, newURL: ${newURL}`, true, NB_W_STY)
// [🐞]
dlog
(
`${NB_W_TAG[0]} inside (EN) ${lang}, pastLang: ${pastLang}, countSlash: ${countSlash}, newURL: ${newURL}`
);
// [ℹ] update URL breadcrumb;
// window.history.replaceState({}, "NewPage", newURL);
Expand All @@ -328,7 +319,12 @@ COMPONENT JS (w/ TS)
? $page.url.pathname.replace(pastLang, `/${lang}/`)
: $page.url.pathname.replace(pastLang, `/${lang}`)
;
dlog(`${NB_W_TAG} inside (V2) ${lang}, pastLang: ${pastLang}, countSlash: ${countSlash}, newURL: ${newURL}`, true, NB_W_STY)
// [🐞]
dlog
(
`${NB_W_TAG[0]} inside (V2) ${lang}, pastLang: ${pastLang}, countSlash: ${countSlash}, newURL: ${newURL}`
);
// [ℹ] update URL breadcrumb;
// window.history.replaceState({}, "NewPage", newURL);
Expand All @@ -342,7 +338,12 @@ COMPONENT JS (w/ TS)
var countSlash = $page.url.pathname.split('/').length - 1;
// [ℹ] replace path-name accordingly for "<lang>" - first occurance;
const newURL: string = $page.url.pathname.replace(pastLang, `/${lang}`);
dlog(`${NB_W_TAG} inside (V3) ${lang}, pastLang: ${pastLang}, countSlash: ${countSlash}, newURL: ${newURL}`, true, NB_W_STY)
// [🐞]
dlog
(
`${NB_W_TAG[0]} inside (V3) ${lang}, pastLang: ${pastLang}, countSlash: ${countSlash}, newURL: ${newURL}`
);
// [ℹ] update URL breadcrumb;
// window.history.replaceState({}, "NewPage", newURL);
Expand Down
48 changes: 32 additions & 16 deletions src/lib/components/_main_/header/Header.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ COMPONENT JS (w/ TS)
import { db_firestore } from '$lib/firebase/init';
import sessionStore from '$lib/store/session.js';
import userBetarenaSettings from '$lib/store/user-settings.js';
import { NB_W_STY, NB_W_TAG, NB_W_TOG, dlog, dlogv2 } from '$lib/utils/debug';
import { NB_W_TAG, dlog, dlogv2 } from '$lib/utils/debug';
import { viewport_change } from '$lib/utils/platform-functions';
import { translationObject } from '$lib/utils/translation.js';
import { initUser, logoutUser } from '$lib/utils/user.js';
Expand Down Expand Up @@ -194,7 +194,13 @@ COMPONENT JS (w/ TS)
}
const lang = $userBetarenaSettings?.lang;
dlog(`${NB_W_TAG} 🔵 Updating platform user lang ${lang}`, NB_W_TOG);
// [🐞]
dlog
(
`${NB_W_TAG[0]} 🔵 Updating platform user lang ${lang}`
);
// [ℹ] (update)from localStorage()
userBetarenaSettings.updateLang(
lang
Expand All @@ -209,7 +215,12 @@ COMPONENT JS (w/ TS)
await updateDoc(userRef, {
lang: lang
});
dlog(`${NB_W_TAG} 🟢 User language has been updated`, NB_W_TOG);
// [🐞]
dlog
(
`${NB_W_TAG[0]} 🟢 User language has been updated`,
);
}
// #endregion ➤ 🛠️ METHODS
Expand All @@ -231,9 +242,10 @@ COMPONENT JS (w/ TS)
$: if (if_R_0 && $userBetarenaSettings.user == undefined)
{
// [🐞]
console.debug
dlog
(
`🚏 checkpoint ➤ NAVBAR if_R_0`,
true
);
userBetarenaSettings.setLang
Expand All @@ -260,17 +272,16 @@ COMPONENT JS (w/ TS)
let userlang: string = $userBetarenaSettings.user?.scores_user_data?.lang;
// [🐞]
console.debug
dlog
(
`🚏 checkpoint ➤ NAVBAR if_R_1`,
true
);
// [🐞]
dlog
(
`${NB_W_TAG} 🔵 User Detected! Setting Auth language! ${userlang}`,
NB_W_TOG,
NB_W_STY
`${NB_W_TAG[0]} 🔵 User Detected! Setting Auth language! ${userlang}`
);
// selectLanguage
Expand Down Expand Up @@ -302,9 +313,10 @@ COMPONENT JS (w/ TS)
$: if (if_R_2)
{
// [🐞]
console.debug
dlog
(
`🚏 checkpoint ➤ NAVBAR if_R_2`,
true
);
initUser
Expand All @@ -326,9 +338,10 @@ COMPONENT JS (w/ TS)
$: if (if_R_3)
{
// [🐞]
console.debug
dlog
(
`🚏 checkpoint ➤ NAVBAR if_R_3`,
true
);
// update_select_lang()
Expand All @@ -354,9 +367,10 @@ COMPONENT JS (w/ TS)
$: if (B_NAV_T?.scores_header_fixtures_information)
{
// [🐞]
console.debug
dlog
(
`🚏 checkpoint ➤ NAVBAR if_R_4`,
true
);
// @ts-expect-error <...>
Expand All @@ -373,19 +387,21 @@ COMPONENT JS (w/ TS)
$: if (browser && $sessionStore.navBtnHover)
{
// [🐞]
console.debug
dlog
(
`🚏 checkpoint ➤ NAVBAR if_R_5`,
true
);
calcNavTrianglePos();
}
$: if (browser && $sessionStore.navBtnHover == undefined)
{
// [🐞]
console.debug
dlog
(
`🚏 checkpoint ➤ NAVBAR if_R_6`,
true
);
calcNavTrianglePos('scores');
Expand All @@ -394,14 +410,14 @@ COMPONENT JS (w/ TS)
// [🐞]
$: dlogv2
(
NB_W_TAG,
NB_W_TAG[0],
[
`$sessionStore?.serverLang: ${$sessionStore?.serverLang}`,
`homepageURL: ${homepageURL}`,
`logoLink: ${logoLink}`
],
NB_W_TOG,
NB_W_STY
NB_W_TAG[1],
NB_W_TAG[2]
)
// #endregion ➤ 🔥 REACTIVIY [SVELTE]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -400,9 +400,10 @@ COMPONENT JS (w/ TS)
if (if_O_0)
{
// [🐞]
console.debug
dlog
(
`🚏 checkpoint ➤ TxHistCalendar if_O_0`,
true
);
initCalendar();
Expand Down
Loading

0 comments on commit cd94ca6

Please sign in to comment.