mirror of
https://github.com/open-webui/open-webui
synced 2024-11-16 05:24:02 +00:00
Merge pull request #2501 from cheahjs/feat/speed-up-loading
refac: speed up app mount by parallelizing API requests
This commit is contained in:
commit
bf6f0c380b
@ -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 modelfiles.set(await getModelfiles(localStorage.token));
|
await Promise.all([
|
||||||
await prompts.set(await getPrompts(localStorage.token));
|
(async () => {
|
||||||
await documents.set(await getDocs(localStorage.token));
|
models.set(await getModels());
|
||||||
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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user