detached a665266

refactor: Simplify login invalidation process

commit
a6652660c71a106540baef89593729e3817028e5
author
Kit · · 2025-02-14 14:19 UTC
parent
cb06b35
signature
SSH UnverifiedSHA256:H91DFuEG4jpk5edzLA4aUKkpv4zv9Q339ipRmkph6Tk The key is unknown
1 file · +2 -9
M src/lib/components/aim-login.svelte +2 -9
@@ -3,7 +3,7 @@
33 import { draggable } from '$lib/actions/draggable';
44 import type { RegisterResponse, RegisterResponseError } from '$lib/types/payloads';
55 import type { User } from '$lib/types/chat';
6- import { invalidate, invalidateAll } from '$app/navigation';
6+ import { invalidateAll } from '$app/navigation';
77
88 let { onLoginSuccess, showAuth = $bindable() }: { onLoginSuccess?: (user: User) => void, showAuth:Boolean } = $props();
99
@@ -59,19 +59,12 @@
5959 console.debug("Login succeeded:", data);
6060 loginStatus = 'success';
6161
62- // Invalidate all session-related dependencies
63- await Promise.all([
64- invalidate('app:session'),
65- invalidate('app:chat'),
66- invalidate('custom:chat:session'),
67- invalidate('chat:session')
68- ]);
69-
7062 // Call the callback prop if provided
7163 onLoginSuccess?.(data.user);
7264 // Auto close login window after 3 seconds on successful login
7365 setTimeout(() => {
7466 console.debug("Auto closing AIM Login component after successful login");
67+ invalidateAll();
7568 handleClose();
7669 }, 3000);
7770
@@ -3,7 +3,7 @@
3 import { draggable } from '$lib/actions/draggable';3 import { draggable } from '$lib/actions/draggable';
4 import type { RegisterResponse, RegisterResponseError } from '$lib/types/payloads';4 import type { RegisterResponse, RegisterResponseError } from '$lib/types/payloads';
5 import type { User } from '$lib/types/chat';5 import type { User } from '$lib/types/chat';
6- import { invalidate, invalidateAll } from '$app/navigation';6+ import { invalidateAll } from '$app/navigation';
7 7
8 let { onLoginSuccess, showAuth = $bindable() }: { onLoginSuccess?: (user: User) => void, showAuth:Boolean } = $props();8 let { onLoginSuccess, showAuth = $bindable() }: { onLoginSuccess?: (user: User) => void, showAuth:Boolean } = $props();
9 9
@@ -59,19 +59,12 @@
59 console.debug("Login succeeded:", data);59 console.debug("Login succeeded:", data);
60 loginStatus = 'success';60 loginStatus = 'success';
61 61
62- // Invalidate all session-related dependencies
63- await Promise.all([
64- invalidate('app:session'),
65- invalidate('app:chat'),
66- invalidate('custom:chat:session'),
67- invalidate('chat:session')
68- ]);
69-
70 // Call the callback prop if provided62 // Call the callback prop if provided
71 onLoginSuccess?.(data.user);63 onLoginSuccess?.(data.user);
72 // Auto close login window after 3 seconds on successful login64 // Auto close login window after 3 seconds on successful login
73 setTimeout(() => {65 setTimeout(() => {
74 console.debug("Auto closing AIM Login component after successful login");66 console.debug("Auto closing AIM Login component after successful login");
67+ invalidateAll();
75 handleClose();68 handleClose();
76 }, 3000);69 }, 3000);
77 70

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 3

Tags 8

↑↓ moveenter openesc close