From a0e193e3435bec109e2df48e004c215ddae1190e Mon Sep 17 00:00:00 2001 From: John O'Keefe Date: Tue, 13 Aug 2024 19:36:39 -0400 Subject: [PATCH] fixed frontend login updating --- frontend/src/App.svelte | 28 +++++++++++-------- .../GlobalVariablesAndHelperFunctions.svelte | 23 +++++++++++++-- 2 files changed, 36 insertions(+), 15 deletions(-) diff --git a/frontend/src/App.svelte b/frontend/src/App.svelte index 080e1ef..ec600d8 100644 --- a/frontend/src/App.svelte +++ b/frontend/src/App.svelte @@ -12,6 +12,8 @@ simklUser, simklWatchList, title, + watchListPage, + animePerPage, } from "./GlobalVariablesAndHelperFunctions.svelte"; import { CheckIfAniListLoggedIn, @@ -41,8 +43,10 @@ aniListWatchlist.subscribe((value) => aniListWatchListLoaded = value) - let page = 1 - let perPage = 20 + let page: number + let perPage: number + watchListPage.subscribe(value => page = value) + animePerPage.subscribe(value => perPage = value) const size = "xl" onMount(async () => { @@ -84,9 +88,9 @@ }) }) - function ChangeWathcListPage(newPage: number) { + function ChangeWatchListPage(newPage: number) { GetAniListUserWatchingList(newPage, perPage, MediaListSort.UpdatedTimeDesc).then((result) => { - page = newPage + watchListPage.set(newPage) aniListWatchlist.set(result) aniListLoggedIn.set(true) }) @@ -111,19 +115,19 @@ {:else}
  • -
  • {/if} {#each {length: aniListWatchListLoaded.data.Page.pageInfo.lastPage} as _, i} {#if i+1 === page}
  • -
  • {:else}
  • -
  • {/if} @@ -136,7 +140,7 @@ {:else}
  • -
  • {/if} @@ -188,19 +192,19 @@ {:else}
  • -
  • {/if} {#each {length: aniListWatchListLoaded.data.Page.pageInfo.lastPage} as _, i} {#if i+1 === page}
  • -
  • {:else}
  • -
  • {/if} @@ -213,7 +217,7 @@ {:else}
  • -
  • {/if} diff --git a/frontend/src/GlobalVariablesAndHelperFunctions.svelte b/frontend/src/GlobalVariablesAndHelperFunctions.svelte index 33d11bf..741977b 100644 --- a/frontend/src/GlobalVariablesAndHelperFunctions.svelte +++ b/frontend/src/GlobalVariablesAndHelperFunctions.svelte @@ -1,7 +1,7 @@