mirror of
https://github.com/open-webui/open-webui.git
synced 2026-08-13 01:02:25 -06:00
fix(ui): deduplicate layout-level API requests (#25942)
This commit is contained in:
@@ -29,10 +29,10 @@
|
||||
|
||||
export let saveHandler: Function;
|
||||
|
||||
let updateAvailable = null;
|
||||
let updateAvailable = false;
|
||||
let version = {
|
||||
current: '',
|
||||
latest: ''
|
||||
current: WEBUI_VERSION,
|
||||
latest: WEBUI_VERSION
|
||||
};
|
||||
|
||||
let adminConfig = null;
|
||||
@@ -106,10 +106,6 @@
|
||||
};
|
||||
|
||||
onMount(async () => {
|
||||
if ($config?.features?.enable_version_update_check) {
|
||||
checkForVersionUpdates();
|
||||
}
|
||||
|
||||
await Promise.all([
|
||||
(async () => {
|
||||
adminConfig = await getAdminConfig(localStorage.token);
|
||||
@@ -129,7 +125,7 @@
|
||||
const ldapConfig = await getLdapConfig(localStorage.token);
|
||||
ENABLE_LDAP = ldapConfig.ENABLE_LDAP;
|
||||
|
||||
banners = await getBanners(localStorage.token);
|
||||
banners = [...$_banners];
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
import { getBanners } from '$lib/apis/configs';
|
||||
import { getTerminalServers } from '$lib/apis/terminal';
|
||||
import { getUserSettings } from '$lib/apis/users';
|
||||
import { setTextScale } from '$lib/utils/text-scale';
|
||||
|
||||
import { WEBUI_VERSION, WEBUI_API_BASE_URL } from '$lib/constants';
|
||||
import { compareVersion } from '$lib/utils';
|
||||
@@ -105,6 +106,8 @@
|
||||
settings.set(userSettings.ui);
|
||||
}
|
||||
|
||||
setTextScale($settings?.textScale ?? 1);
|
||||
|
||||
if (cb) {
|
||||
await cb();
|
||||
}
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
<script>
|
||||
import { goto } from '$app/navigation';
|
||||
import { onMount } from 'svelte';
|
||||
import Settings from '$lib/components/admin/Settings.svelte';
|
||||
|
||||
onMount(() => {
|
||||
goto('/admin/settings/general');
|
||||
});
|
||||
</script>
|
||||
|
||||
<Settings />
|
||||
|
||||
@@ -993,18 +993,6 @@
|
||||
$socket?.on('events', chatEventHandler);
|
||||
$socket?.on('events:channel', channelEventHandler);
|
||||
|
||||
const userSettings = await getUserSettings(localStorage.token);
|
||||
if (userSettings) {
|
||||
settings.set(userSettings.ui);
|
||||
} else {
|
||||
try {
|
||||
settings.set(JSON.parse(localStorage.getItem('settings') ?? '{}'));
|
||||
} catch {
|
||||
settings.set({});
|
||||
}
|
||||
}
|
||||
setTextScale($settings?.textScale ?? 1);
|
||||
|
||||
// Set up the token expiry check
|
||||
if (tokenTimer) {
|
||||
clearInterval(tokenTimer);
|
||||
|
||||
Reference in New Issue
Block a user