refactor(frontend): Svelte 5 mount API, router v5, dependency-free table
main.ts uses mount() instead of the legacy constructor. App.svelte follows svelte-spa-router v5: the removed loc store becomes router.location, while wrap/push/link keep their v4 call shapes. AnimeTable.svelte drops svelte-headless-table and reimplements the same 11 sortable columns (WebsiteLink id cells, asc/desc indicators, click toggles through asc/desc/off) with local $state/$derived - about 120 lines, no dependency, fully covered by svelte-check instead of the libs view model.
This commit is contained in:
@@ -21,13 +21,13 @@
|
||||
import { CheckIfMALLoggedInAndSetUser } from "./helperModules/CheckIfMyAnimeListLoggedIn.svelte";
|
||||
import { CheckIfSimklLoggedInAndSetUser } from "./helperModules/CheckIsSimklLoggedIn.svelte";
|
||||
import {App} from "../bindings/AniTrack";
|
||||
import { loc } from "svelte-spa-router";
|
||||
import { router } from "svelte-spa-router";
|
||||
import ErrorModal from "./helperComponents/ErrorModal.svelte";
|
||||
|
||||
onMount(async () => {
|
||||
let isAniListLoggedIn: boolean;
|
||||
let isMALLoggedIn: boolean;
|
||||
let isSimklLoggedIn: boolean;
|
||||
let isAniListLoggedIn!: boolean;
|
||||
let isMALLoggedIn!: boolean;
|
||||
let isSimklLoggedIn!: boolean;
|
||||
aniListLoggedIn.subscribe((value) => (isAniListLoggedIn = value));
|
||||
malLoggedIn.subscribe((value) => (isMALLoggedIn = value));
|
||||
simklLoggedIn.subscribe((value) => (isSimklLoggedIn = value));
|
||||
@@ -39,7 +39,7 @@
|
||||
!isSimklLoggedIn && (await CheckIfSimklLoggedInAndSetUser());
|
||||
});
|
||||
|
||||
$: if ($loc?.location === "/" && $watchlistNeedsRefresh) {
|
||||
$: if (router.location === "/" && $watchlistNeedsRefresh) {
|
||||
(async () => {
|
||||
if ($aniListLoggedIn && $aniListPrimary) {
|
||||
await CheckIfAniListLoggedInAndLoadWatchList();
|
||||
|
||||
Reference in New Issue
Block a user