Private
Public Access
actualizado tema tokens
This commit is contained in:
1 parent
38afdcc742
commit
441e2f5833
28 files changed
+506
-194
No files matched your search
@@ -2,7 +2,7 @@
|
||||
import './layout.css';
|
||||
import 'carbon-components-svelte/css/all.css';
|
||||
import favicon from '$lib/assets/favicon.svg';
|
||||
import { getToken } from '$lib/hooks/token';
|
||||
import { AUTH_CHANGE_EVENT, getToken } from '$lib/hooks/token';
|
||||
import { goto } from '$app/navigation';
|
||||
import { TokenRefresher } from '$lib/TokenRefresher.svelte';
|
||||
|
||||
@@ -14,6 +14,20 @@
|
||||
document.documentElement.setAttribute('theme', theme);
|
||||
});
|
||||
|
||||
$effect(() => {
|
||||
const syncToken = () => {
|
||||
token = getToken();
|
||||
};
|
||||
|
||||
window.addEventListener(AUTH_CHANGE_EVENT, syncToken);
|
||||
window.addEventListener('storage', syncToken);
|
||||
|
||||
return () => {
|
||||
window.removeEventListener(AUTH_CHANGE_EVENT, syncToken);
|
||||
window.removeEventListener('storage', syncToken);
|
||||
};
|
||||
});
|
||||
|
||||
let _refresher: TokenRefresher;
|
||||
|
||||
$effect(() => {
|
||||
|
||||
Reference in new issue
Block a user