2024-07-09 10:16:53 -04:00
|
|
|
<script lang="ts">
|
2024-08-09 15:14:39 -04:00
|
|
|
import {
|
|
|
|
aniListLoggedIn,
|
2024-09-04 12:05:41 -04:00
|
|
|
aniListAnime,
|
|
|
|
GetAniListSingleItem,
|
2024-09-07 21:13:15 -04:00
|
|
|
} from "./helperModules/GlobalVariablesAndHelperFunctions.svelte";
|
2024-07-30 20:37:44 -04:00
|
|
|
import {onMount} from "svelte";
|
2024-09-04 12:05:41 -04:00
|
|
|
import Router from "svelte-spa-router"
|
|
|
|
import Home from "./routes/Home.svelte";
|
|
|
|
import {wrap} from "svelte-spa-router/wrap";
|
|
|
|
import Spinner from "./helperComponents/Spinner.svelte";
|
|
|
|
import Header from "./helperComponents/Header.svelte";
|
2024-09-07 21:13:15 -04:00
|
|
|
import {CheckIfAniListLoggedInAndLoadWatchList} from "./helperModules/CheckIfAniListLoggedInAndLoadWatchList.svelte";
|
|
|
|
import { CheckIfMALLoggedInAndSetUser } from "./helperModules/CheckIfMyAnimeListLoggedIn.svelte";
|
|
|
|
import {CheckIfSimklLoggedInAndSetUser} from "./helperModules/CheckIsSimklLoggedIn.svelte"
|
2024-07-25 20:02:15 -04:00
|
|
|
|
2024-07-30 20:37:44 -04:00
|
|
|
onMount(async () => {
|
2024-09-07 21:13:15 -04:00
|
|
|
await CheckIfAniListLoggedInAndLoadWatchList()
|
|
|
|
await CheckIfMALLoggedInAndSetUser()
|
|
|
|
await CheckIfSimklLoggedInAndSetUser()
|
2024-07-30 20:37:44 -04:00
|
|
|
})
|
2024-07-09 10:16:53 -04:00
|
|
|
</script>
|
|
|
|
|
2024-09-04 12:05:41 -04:00
|
|
|
<Header />
|
|
|
|
<Router routes={{
|
|
|
|
'/': Home,
|
|
|
|
'/anime/:id': wrap({
|
2024-09-04 12:26:26 -04:00
|
|
|
asyncComponent: () => import('./routes/Anime.svelte'),
|
2024-09-04 12:05:41 -04:00
|
|
|
conditions: [
|
2024-09-05 15:29:42 -04:00
|
|
|
() => $aniListLoggedIn,
|
2024-09-04 12:05:41 -04:00
|
|
|
async (detail) => {
|
|
|
|
await GetAniListSingleItem(Number(detail.params.id), true)
|
|
|
|
return Object.keys($aniListAnime).length!==0
|
|
|
|
},
|
|
|
|
],
|
|
|
|
loadingComponent: Spinner
|
|
|
|
}),
|
|
|
|
// '*': "Not Found"
|
|
|
|
}} />
|