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
@@ -169,9 +169,19 @@ export function parseCustomKeybindings(
|
||||
}
|
||||
}
|
||||
|
||||
const userPreferencesCache = createTtlRequestCache<UserPreferences>(10_000);
|
||||
|
||||
/**
|
||||
* Cached briefly so the loading gate's prefetch and the shell's own read on
|
||||
* mount share one request instead of two, which is what let stale
|
||||
* localStorage flags (hiddenRailTabs, pinAppRail) flash before the real
|
||||
* values landed a moment after the shell first rendered.
|
||||
*/
|
||||
export async function getUserPreferences(): Promise<UserPreferences> {
|
||||
const response = await authApi.get("/user-preferences");
|
||||
return response.data;
|
||||
return userPreferencesCache.get(async () => {
|
||||
const response = await authApi.get("/user-preferences");
|
||||
return response.data;
|
||||
});
|
||||
}
|
||||
|
||||
export async function saveUserPreferences(
|
||||
|
||||
Reference in new issue
Block a user