mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-23 09:10:55 -05:00
refac
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
|
||||
import { toast } from 'svelte-sonner';
|
||||
|
||||
import { onMount, getContext, tick } from 'svelte';
|
||||
import { onMount, getContext } from 'svelte';
|
||||
import { goto } from '$app/navigation';
|
||||
import { page } from '$app/stores';
|
||||
|
||||
@@ -142,29 +142,6 @@
|
||||
|
||||
let onboarding = false;
|
||||
|
||||
async function setLogoImage() {
|
||||
await tick();
|
||||
const logo = document.getElementById('logo');
|
||||
|
||||
if (logo) {
|
||||
const isDarkMode = document.documentElement.classList.contains('dark');
|
||||
|
||||
if (isDarkMode) {
|
||||
const darkImage = new Image();
|
||||
darkImage.src = `${WEBUI_BASE_URL}/static/favicon-dark.png`;
|
||||
|
||||
darkImage.onload = () => {
|
||||
logo.src = `${WEBUI_BASE_URL}/static/favicon-dark.png`;
|
||||
logo.style.filter = ''; // Ensure no inversion is applied if favicon-dark.png exists
|
||||
};
|
||||
|
||||
darkImage.onerror = () => {
|
||||
logo.style.filter = 'invert(1)'; // Invert image if favicon-dark.png is missing
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
onMount(async () => {
|
||||
const redirectPath = $page.url.searchParams.get('redirect');
|
||||
if ($user) {
|
||||
@@ -205,7 +182,6 @@
|
||||
}
|
||||
|
||||
loaded = true;
|
||||
setLogoImage();
|
||||
|
||||
if (($config?.features?.auth_trusted_header ?? false) || $config?.features?.auth === false) {
|
||||
await signInHandler();
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 16 KiB |
Reference in New Issue
Block a user