feat(ui): show per-service login status while accounts are being checked

When the app starts it verifies all three services sequentially, which
could leave the other two login controls looking idle or trigger login
actions before their real state is known. Track which service is
currently being checked and reflect it in the header:

- Add a serviceLoggingIn store (plus setServiceLoggingIn and
  isServiceLoggingIn helpers) to GlobalVariablesAndHelperFunctions.
- Have the loginTo* functions and the startup CheckIf* functions toggle
  their service in the store (seed all three at startup, clear each as
  it resolves).
- In Header, the login buttons show a spinner with 'Checking AniList' /
  'Checking MAL' / 'Checking Simkl' and are disabled while that service
  is being checked, reverting to the normal 'AniList Login' style label
  once its state is known.
- In the avatar menu, the 'Login to X' row shows a spinner with the
  matching 'Checking X' text while that service is logging in.
This commit is contained in:
2026-08-29 13:13:42 -04:00
parent d08756c36f
commit a16c804692
7 changed files with 173 additions and 63 deletions
@@ -14,6 +14,7 @@
aniListSort,
clearApiError,
setApiError,
serviceLoggingIn,
} from "./GlobalVariablesAndHelperFunctions.svelte";
let isAniListPrimary: boolean;
@@ -60,6 +61,7 @@
}
};
export const CheckIfAniListLoggedInAndLoadWatchList = async () => {
serviceLoggingIn.update((s) => [...s, "anilist"]);
try {
const loggedIn = await CheckIfAniListLoggedIn();
if (loggedIn) {
@@ -76,6 +78,8 @@
true,
);
aniListLoggedIn.set(false);
} finally {
serviceLoggingIn.update((s) => s.filter((item) => item !== "anilist"));
}
};
</script>