Skip to content

Commit 6940297

Browse files
committed
refac
1 parent 49e57f4 commit 6940297

2 files changed

Lines changed: 1 addition & 25 deletions

File tree

src/routes/auth/+page.svelte

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
import { toast } from 'svelte-sonner';
66
7-
import { onMount, getContext, tick } from 'svelte';
7+
import { onMount, getContext } from 'svelte';
88
import { goto } from '$app/navigation';
99
import { page } from '$app/stores';
1010
@@ -142,29 +142,6 @@
142142
143143
let onboarding = false;
144144
145-
async function setLogoImage() {
146-
await tick();
147-
const logo = document.getElementById('logo');
148-
149-
if (logo) {
150-
const isDarkMode = document.documentElement.classList.contains('dark');
151-
152-
if (isDarkMode) {
153-
const darkImage = new Image();
154-
darkImage.src = `${WEBUI_BASE_URL}/static/favicon-dark.png`;
155-
156-
darkImage.onload = () => {
157-
logo.src = `${WEBUI_BASE_URL}/static/favicon-dark.png`;
158-
logo.style.filter = ''; // Ensure no inversion is applied if favicon-dark.png exists
159-
};
160-
161-
darkImage.onerror = () => {
162-
logo.style.filter = 'invert(1)'; // Invert image if favicon-dark.png is missing
163-
};
164-
}
165-
}
166-
}
167-
168145
onMount(async () => {
169146
const redirectPath = $page.url.searchParams.get('redirect');
170147
if ($user) {
@@ -205,7 +182,6 @@
205182
}
206183
207184
loaded = true;
208-
setLogoImage();
209185
210186
if (($config?.features?.auth_trusted_header ?? false) || $config?.features?.auth === false) {
211187
await signInHandler();

static/static/favicon-dark.png

-15.5 KB
Binary file not shown.

0 commit comments

Comments
 (0)