-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
142 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,65 +1,62 @@ | ||
// ╭──────────────────────────────────────────────────────────────────────────────────╮ | ||
// │ 📌 High Order Component Overview │ | ||
// ┣──────────────────────────────────────────────────────────────────────────────────┫ | ||
// │ ➤ Internal Svelte Code Format :|: V.8.0 │ | ||
// │ ➤ Status :|: 🔒 LOCKED │ | ||
// │ ➤ Author(s) :|: @migbash │ | ||
// ┣──────────────────────────────────────────────────────────────────────────────────┫ | ||
// │ 📝 Description │ | ||
// ┣──────────────────────────────────────────────────────────────────────────────────┫ | ||
// │ Main Scores Platform Page Loader ('Client-Side') │ | ||
// ╰──────────────────────────────────────────────────────────────────────────────────╯ | ||
|
||
// #region ➤ 📦 Package Imports | ||
// // ╭──────────────────────────────────────────────────────────────────────────────────╮ | ||
// // │ 📌 High Order Component Overview │ | ||
// // ┣──────────────────────────────────────────────────────────────────────────────────┫ | ||
// // │ ➤ Internal Svelte Code Format :|: V.8.0 │ | ||
// // │ ➤ Status :|: 🔒 LOCKED │ | ||
// // │ ➤ Author(s) :|: @migbash │ | ||
// // ┣──────────────────────────────────────────────────────────────────────────────────┫ | ||
// // │ 📝 Description │ | ||
// // ┣──────────────────────────────────────────────────────────────────────────────────┫ | ||
// // │ Main Scores Platform Page Loader ('Client-Side') │ | ||
// // ╰──────────────────────────────────────────────────────────────────────────────────╯ | ||
|
||
// // #region ➤ 📦 Package Imports | ||
|
||
// import { ServerLoadEvent, redirect } from '@sveltejs/kit'; | ||
|
||
// import { main } from '$lib/sveltekit/load/load.lang.js'; | ||
// import { dlogv2 } from '$lib/utils/debug.js'; | ||
// import { getUserById, userDataFetch } from '$lib/firebase/common.js'; | ||
|
||
// #endregion ➤ 📦 Package Imports | ||
// // #endregion ➤ 📦 Package Imports | ||
|
||
// #region ➤ 🔄 LIFECYCLE [SVELTE] | ||
// // #region ➤ 🔄 LIFECYCLE [SVELTE] | ||
|
||
// /** | ||
// * @type {import('./$types').PageLoad} | ||
// */ | ||
// // /** | ||
// // * @type {import('./$types').PageLoad} | ||
// // */ | ||
// export async function load | ||
// ( | ||
// event: ServerLoadEvent | ||
// ): Promise < any > | ||
// { | ||
// console.log("EVENT :", event); | ||
// const userId = await JSON.parse(event.locals.user); | ||
// console.log("COOKIES :", userId["user-uid"]); | ||
// if (!userId) redirect(300, "/scores"); | ||
// const user = await getUserById(userId); | ||
// const { langParam } = await event.parent(); | ||
// // [🐞] | ||
// dlogv2 | ||
// ( | ||
// '🚏 checkpoint ➤ src/routes/(scores)/[[lang=lang]]/+page.server.ts', | ||
// [ | ||
// `🔹 [var] ➤ langParam :|: ${langParam}`, | ||
// ], | ||
// true | ||
// ); | ||
// const defaultRedirectURL = `${langParam !== "en" ? `/${langParam}` : ""}/scores`; | ||
// console.log("langParam1 :", langParam); | ||
// const event_user = await JSON.parse(event.locals.user); | ||
// const userId = event_user["user-uid"]; | ||
// console.log("COOKIES UID:", userId); | ||
|
||
// const user = userId ? await getUserById(userId) : null; | ||
// console.log("USER :", user); | ||
// if (!user) redirect(300, "/scores"); | ||
// const | ||
// d = await event.parent() | ||
// ; | ||
// console.log("PARENT DATA :", d); | ||
// const {langParam} = d; | ||
// // [🐞] | ||
// dlogv2 | ||
// ( | ||
// '🚏 checkpoint ➤ src/routes/(scores)/[[lang=lang]]/+page.server.ts', | ||
// [ | ||
// `🔹 [var] ➤ langParam :|: ${langParam}`, | ||
// ], | ||
// true | ||
// ); | ||
// if (user) | ||
// { | ||
// return {} | ||
// }; | ||
// console.log("REDIRECTING...", defaultRedirectURL) | ||
// redirect(300, defaultRedirectURL) | ||
|
||
|
||
// return await main | ||
// ( | ||
// event, | ||
// { | ||
// langParam | ||
// } | ||
// ); | ||
|
||
// } | ||
|
||
// #endregion ➤ 🔄 LIFECYCLE [SVELTE] | ||
// // #endregion ➤ 🔄 LIFECYCLE [SVELTE] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters