mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-29 06:35:24 +00:00
feat: improve UI loading time and jitter
This commit is contained in:
1 parent
0f8956dcf3
commit
4a320a2258
8 files changed
+279
-137
No files matched your search
@@ -56,6 +56,15 @@ export async function hasPermission(permission: string): Promise<boolean> {
|
||||
return matchesPermission(permissions, isAdmin, permission);
|
||||
}
|
||||
|
||||
/**
|
||||
* Warms the permissions cache before the shell mounts, so permission-gated
|
||||
* rail items are already known on first paint instead of popping in once
|
||||
* usePermissions' own fetch resolves.
|
||||
*/
|
||||
export function preloadPermissions(): Promise<void> {
|
||||
return load().then(() => undefined);
|
||||
}
|
||||
|
||||
export function notifyPermissionsChanged(): void {
|
||||
cache = null;
|
||||
window.dispatchEvent(new Event(PERMISSIONS_CHANGED_EVENT));
|
||||
|
||||
Reference in new issue
Block a user