moved login data to header
This commit is contained in:
@ -9,9 +9,7 @@
|
||||
aniListUser,
|
||||
aniListPrimary,
|
||||
aniListWatchlist,
|
||||
loginToAniList,
|
||||
GetAniListSingleItemAndOpenModal,
|
||||
loginToSimkl
|
||||
} from "./GlobalVariablesAndHelperFunctions.svelte";
|
||||
import {
|
||||
CheckIfAniListLoggedIn,
|
||||
@ -21,28 +19,21 @@
|
||||
GetSimklLoggedInUser,
|
||||
SimklGetUserWatchlist,
|
||||
} from "../wailsjs/go/main/App";
|
||||
import {type AniListUser, MediaListSort} from "./anilist/types/AniListTypes";
|
||||
import {MediaListSort} from "./anilist/types/AniListTypes";
|
||||
import type {AniListCurrentUserWatchList} from "./anilist/types/AniListCurrentUserWatchListType"
|
||||
import Header from "./Header.svelte";
|
||||
import {Button, Rating} from "flowbite-svelte";
|
||||
import {Rating} from "flowbite-svelte";
|
||||
import {default as Modal} from "./modal/Modal.svelte"
|
||||
import ChangeDataDialogue from "./ChangeDataDialogue.svelte";
|
||||
import {onMount} from "svelte";
|
||||
import type {SimklUser} from "./simkl/types/simklTypes";
|
||||
|
||||
|
||||
|
||||
let isAniListLoggedIn: boolean
|
||||
let isSimklLoggedIn: boolean
|
||||
let currentSimklUser: SimklUser
|
||||
let currentAniListUser: AniListUser
|
||||
let isAniListPrimary: boolean
|
||||
let aniListWatchListLoaded: AniListCurrentUserWatchList
|
||||
|
||||
aniListLoggedIn.subscribe((value) => isAniListLoggedIn = value)
|
||||
simklLoggedIn.subscribe((value) => isSimklLoggedIn = value)
|
||||
simklUser.subscribe((value) => currentSimklUser = value)
|
||||
aniListUser.subscribe((value) => currentAniListUser = value)
|
||||
aniListPrimary.subscribe((value) => isAniListPrimary = value)
|
||||
aniListWatchlist.subscribe((value) => aniListWatchListLoaded = value)
|
||||
|
||||
@ -85,18 +76,6 @@
|
||||
<Header/>
|
||||
|
||||
<main>
|
||||
{#if isAniListLoggedIn}
|
||||
<div>You are logged into AniList, {currentAniListUser.data.Viewer.name}!</div>
|
||||
{:else}
|
||||
<button class="btn" on:click={loginToAniList}>Login to AniList</button>
|
||||
{/if}
|
||||
|
||||
{#if isSimklLoggedIn}
|
||||
<div>You are logged into Simkl, {currentSimklUser.user.name}</div>
|
||||
{:else}
|
||||
<Button class="btn" on:click={loginToSimkl}>Login to Simkl</Button>
|
||||
{/if}
|
||||
|
||||
{#if isAniListLoggedIn}
|
||||
<div class="mx-auto max-w-2xl p-4 sm:p-6 lg:max-w-7xl lg:px-8">
|
||||
<h1 class="text-left text-xl font-bold mb-4">Your Watching List</h1>
|
||||
|
Reference in New Issue
Block a user