moved helper variables to make them global

This commit is contained in:
John O'Keefe 2024-08-09 15:10:47 -04:00
parent 1e90f68e70
commit 46e2a9156f

View File

@ -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)
})
}