diff --git a/src/features/settings/sections/TrackingSettings.svelte b/src/features/settings/sections/TrackingSettings.svelte index 08a7a7b..33ebd94 100644 --- a/src/features/settings/sections/TrackingSettings.svelte +++ b/src/features/settings/sections/TrackingSettings.svelte @@ -16,10 +16,12 @@ let oauthTrackerId = $state(null); let oauthCallbackInput = $state(""); let oauthSubmitting = $state(false); + let oauthError = $state(null); let credsTrackerId = $state(null); let credsUsername = $state(""); let credsPassword = $state(""); let credsSubmitting = $state(false); + let credsError = $state(null); let loggingOut = $state(null); $effect(() => { @@ -50,11 +52,11 @@ await loadTrackers(); oauthTrackerId = null; oauthCallbackInput = ""; } catch (e: any) { - trackersError = e?.message ?? "Login failed"; + oauthError = e?.message ?? "Login failed"; } finally { oauthSubmitting = false; } } - function cancelOAuth() { oauthTrackerId = null; oauthCallbackInput = ""; } + function cancelOAuth() { oauthTrackerId = null; oauthCallbackInput = ""; oauthError = null; } function startCredentials(tracker: Tracker) { credsTrackerId = tracker.id; credsUsername = ""; credsPassword = ""; } @@ -66,11 +68,11 @@ await loadTrackers(); credsTrackerId = null; credsUsername = ""; credsPassword = ""; } catch (e: any) { - trackersError = e?.message ?? "Login failed"; + credsError = e?.message ?? "Login failed"; } finally { credsSubmitting = false; } } - function cancelCredentials() { credsTrackerId = null; credsUsername = ""; credsPassword = ""; } + function cancelCredentials() { credsTrackerId = null; credsUsername = ""; credsPassword = ""; credsError = null; } async function logoutTracker(trackerId: number) { loggingOut = trackerId; @@ -127,7 +129,7 @@

Connected Trackers

{#if trackersError} -
{trackersError}
+
trackersError = null} role="button" tabindex="0" onkeydown={(e) => e.key === "Enter" && (trackersError = null)}>{trackersError}
{/if} {#if trackersLoading}

Loading trackers…

@@ -168,6 +170,9 @@
{#if oauthTrackerId === tracker.id}
+ {#if oauthError} +
oauthError = null} role="button" tabindex="0" onkeydown={(e) => e.key === "Enter" && (oauthError = null)}>{oauthError}
+ {/if}

Browser opened {tracker.name} login — authorise then paste the callback URL below.

+ {#if credsError} +
credsError = null} role="button" tabindex="0" onkeydown={(e) => e.key === "Enter" && (credsError = null)}>{credsError}
+ {/if} e.key === "Escape" && cancelCredentials()} use:focusEl /> .s-tracker-status-row { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; } .s-pill-warn { background: color-mix(in srgb, var(--color-warn, #c97c2b) 15%, transparent); color: var(--color-warn, #c97c2b); border-color: color-mix(in srgb, var(--color-warn, #c97c2b) 35%, transparent); } + .s-banner-dismissible { cursor: pointer; max-height: 8rem; overflow-y: auto; } + .s-banner-dismissible:hover { opacity: 0.85; } \ No newline at end of file