refac: rm ai slop

This commit is contained in:
Timothy Jaeryang Baek
2025-11-19 03:51:10 -05:00
parent 88416161cc
commit 76dbbf57d2
5 changed files with 48 additions and 149 deletions
+15 -3
View File
@@ -47,10 +47,12 @@
import { WEBUI_BASE_URL, WEBUI_HOSTNAME } from '$lib/constants';
import { bestMatchingLanguage } from '$lib/utils';
import { setTextScale } from '$lib/utils/text-scale';
import NotificationToast from '$lib/components/NotificationToast.svelte';
import AppSidebar from '$lib/components/app/AppSidebar.svelte';
import Spinner from '$lib/components/common/Spinner.svelte';
import { getUserSettings } from '$lib/apis/users';
// handle frontend updates (https://svelte.dev/docs/kit/configuration#version)
beforeNavigate(({ willUnload, to }) => {
@@ -524,8 +526,10 @@
}
});
if (typeof window !== 'undefined' && window.applyTheme) {
window.applyTheme();
if (typeof window !== 'undefined') {
if (window.applyTheme) {
window.applyTheme();
}
}
if (window?.electronAPI) {
@@ -584,7 +588,7 @@
};
window.addEventListener('resize', onResize);
user.subscribe((value) => {
user.subscribe(async (value) => {
if (value) {
$socket?.off('events', chatEventHandler);
$socket?.off('events:channel', channelEventHandler);
@@ -592,6 +596,14 @@
$socket?.on('events', chatEventHandler);
$socket?.on('events:channel', channelEventHandler);
const userSettings = await getUserSettings(localStorage.token);
if (userSettings) {
settings.set(userSettings.ui);
} else {
settings.set(JSON.parse(localStorage.getItem('settings') ?? '{}'));
}
setTextScale($settings?.textScale ?? 1);
// Set up the token expiry check
if (tokenTimer) {
clearInterval(tokenTimer);