mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-07 02:58:21 +00:00
feat: load banners on navigation to homepage, not only on refresh (#22340)
This commit is contained in:
parent
ce54b1df23
commit
c73efab192
1 changed files with 8 additions and 1 deletions
|
|
@ -86,6 +86,7 @@
|
|||
stopTask,
|
||||
getTaskIdsByChatId
|
||||
} from '$lib/apis';
|
||||
import { getBanners } from '$lib/apis/configs';
|
||||
import { getTools } from '$lib/apis/tools';
|
||||
import { uploadFile } from '$lib/apis/files';
|
||||
import { createOpenAITextStream } from '$lib/apis/streaming';
|
||||
|
|
@ -649,7 +650,13 @@
|
|||
if (p.url.pathname === '/') {
|
||||
await tick();
|
||||
initNewChat();
|
||||
banners.set(await getBanners(localStorage.token).catch(() => []));
|
||||
|
||||
// Re-fetch banners on navigation to homepage so newly configured banners appear
|
||||
try {
|
||||
banners.set(await getBanners(localStorage.token).catch(() => []));
|
||||
} catch (e) {
|
||||
console.error('Failed to refresh banners:', e);
|
||||
}
|
||||
}
|
||||
|
||||
stopAudio();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue