From 46e2a9156fdd469081f1692e785f1d6598cee46b Mon Sep 17 00:00:00 2001 From: John O'Keefe Date: Fri, 9 Aug 2024 15:10:47 -0400 Subject: [PATCH] moved helper variables to make them global --- ...te => GlobalVariablesAndHelperFunctions.svelte} | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) rename frontend/src/{GetAniListSingleItemAndOpenModal.svelte => GlobalVariablesAndHelperFunctions.svelte} (50%) diff --git a/frontend/src/GetAniListSingleItemAndOpenModal.svelte b/frontend/src/GlobalVariablesAndHelperFunctions.svelte similarity index 50% rename from frontend/src/GetAniListSingleItemAndOpenModal.svelte rename to frontend/src/GlobalVariablesAndHelperFunctions.svelte index 1b55db8..e04c26b 100644 --- a/frontend/src/GetAniListSingleItemAndOpenModal.svelte +++ b/frontend/src/GlobalVariablesAndHelperFunctions.svelte @@ -2,17 +2,21 @@ import {GetAniListItem} from "../wailsjs/go/main/App"; import type {AniListGetSingleAnime} from "./anilist/types/AniListCurrentUserWatchListType.js"; import {writable} from 'svelte/store' + import type {SimklWatchList} from "./simkl/types/simklTypes"; - export let anime: AniListGetSingleAnime + export let aniListAnime: AniListGetSingleAnime export let title = writable("") export let anilistModal = writable(false); + export let aniListLoggedIn = writable(false) + export let simklLoggedIn = writable(false) + export let simklWatchList = writable({} as SimklWatchList) export function GetAniListSingleItemAndOpenModal(aniId: number, login: boolean): void { GetAniListItem(aniId, login).then(result => { - anime = result - title.set(anime.data.MediaList.media.title.english === "" ? - anime.data.MediaList.media.title.romaji : - anime.data.MediaList.media.title.english) + aniListAnime = result + title.set(aniListAnime.data.MediaList.media.title.english === "" ? + aniListAnime.data.MediaList.media.title.romaji : + aniListAnime.data.MediaList.media.title.english) anilistModal.set(true) }) }