moved helper variables to make them global
This commit is contained in:
parent
1e90f68e70
commit
46e2a9156f
@ -2,17 +2,21 @@
|
|||||||
import {GetAniListItem} from "../wailsjs/go/main/App";
|
import {GetAniListItem} from "../wailsjs/go/main/App";
|
||||||
import type {AniListGetSingleAnime} from "./anilist/types/AniListCurrentUserWatchListType.js";
|
import type {AniListGetSingleAnime} from "./anilist/types/AniListCurrentUserWatchListType.js";
|
||||||
import {writable} from 'svelte/store'
|
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 title = writable("")
|
||||||
export let anilistModal = writable(false);
|
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 {
|
export function GetAniListSingleItemAndOpenModal(aniId: number, login: boolean): void {
|
||||||
GetAniListItem(aniId, login).then(result => {
|
GetAniListItem(aniId, login).then(result => {
|
||||||
anime = result
|
aniListAnime = result
|
||||||
title.set(anime.data.MediaList.media.title.english === "" ?
|
title.set(aniListAnime.data.MediaList.media.title.english === "" ?
|
||||||
anime.data.MediaList.media.title.romaji :
|
aniListAnime.data.MediaList.media.title.romaji :
|
||||||
anime.data.MediaList.media.title.english)
|
aniListAnime.data.MediaList.media.title.english)
|
||||||
anilistModal.set(true)
|
anilistModal.set(true)
|
||||||
})
|
})
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user