Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
bf6f0c38
Unverified
Commit
bf6f0c38
authored
May 22, 2024
by
Timothy Jaeryang Baek
Committed by
GitHub
May 22, 2024
Browse files
Merge pull request #2501 from cheahjs/feat/speed-up-loading
refac: speed up app mount by parallelizing API requests
parents
f8778333
929384e3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
8 deletions
+20
-8
src/routes/(app)/+layout.svelte
src/routes/(app)/+layout.svelte
+20
-8
No files found.
src/routes/(app)/+layout.svelte
View file @
bf6f0c38
...
@@ -87,17 +87,29 @@
...
@@ -87,17 +87,29 @@
// IndexedDB Not Found
// IndexedDB Not Found
}
}
await models.set(await getModels());
settings.set(JSON.parse(localStorage.getItem('settings') ?? '{}'));
await settings.set(JSON.parse(localStorage.getItem('settings') ?? '{}'));
await Promise.all([
await modelfiles.set(await getModelfiles(localStorage.token));
(async () => {
await prompts.set(await getPrompts(localStorage.token));
models.set(await getModels());
await documents.set(await getDocs(localStorage.token));
})(),
await tags.set(await getAllChatTags(localStorage.token));
(async () => {
modelfiles.set(await getModelfiles(localStorage.token));
})(),
(async () => {
prompts.set(await getPrompts(localStorage.token));
})(),
(async () => {
documents.set(await getDocs(localStorage.token));
})(),
(async () => {
tags.set(await getAllChatTags(localStorage.token));
})()
]);
modelfiles.subscribe(async () => {
modelfiles.subscribe(async () => {
// should fetch models
// should fetch models
await
models.set(await getModels());
models.set(await getModels());
});
});
document.addEventListener('keydown', function (event) {
document.addEventListener('keydown', function (event) {
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment