feat(frontend): integrate error handling into application
App.svelte: - Import and render ErrorModal component - Add ErrorModal to main app layout below Header CheckIfAniListLoggedInAndLoadWatchList.svelte: - Import error state helpers (setApiError, clearApiError) - Wrap LoadAniListUser in try-catch with error handling - Wrap LoadAniListWatchList in try-catch with error handling - Update CheckIfAniListLoggedInAndLoadWatchList with error handling - Remove old alert() calls in favor of modal system Home.svelte: - Import isApiDown and apiError stores - Add conditional rendering for API down state - Display user-friendly "API Unavailable" message when apiError is set - Show warning icon and helpful messaging Error handling is now fully integrated across the frontend application.
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
SimklGetUserWatchlist,
|
||||
} from "../wailsjs/go/main/App";
|
||||
import { loc } from "svelte-spa-router";
|
||||
import ErrorModal from "./helperComponents/ErrorModal.svelte";
|
||||
|
||||
onMount(async () => {
|
||||
let isAniListLoggedIn: boolean;
|
||||
@@ -57,6 +58,7 @@
|
||||
</script>
|
||||
|
||||
<Header />
|
||||
<ErrorModal />
|
||||
<Router
|
||||
routes={{
|
||||
"/": Home,
|
||||
|
||||
Reference in New Issue
Block a user