Chore: Fixed ServerURL & AppPin on WebUI

This commit is contained in:
Youwes09
2026-06-13 02:25:12 -05:00
parent baece20f46
commit 09d794da96
7 changed files with 80 additions and 80 deletions
@@ -91,10 +91,11 @@
const PHASE2_MS = 10000
function triggerExit(cb?: () => void) {
if (exitLock) return
console.log('[splash] triggerExit called — exitLock:', exitLock, 'mode:', mode, 'cb:', cb?.name ?? String(cb))
if (exitLock) { console.log('[splash] triggerExit blocked by exitLock'); return }
exitLock = true
exiting = true
setTimeout(() => cb?.(), EXIT_MS)
setTimeout(() => { console.log('[splash] triggerExit timeout — calling cb'); cb?.() }, EXIT_MS)
}
let animFrame = 0
@@ -125,11 +126,13 @@
})
$effect(() => {
console.log('[splash] ringFull effect — ringFull:', ringFull, 'mode:', mode, 'exitLock:', exitLock)
if (!ringFull || mode === 'locked') { exitLock = false; exiting = false; return }
cancelAnimationFrame(animFrame)
animFrame = 0
ringProg = 1
setTimeout(() => triggerExit(onReady), 650)
const t = setTimeout(() => { console.log('[splash] ringFull timeout firing — calling triggerExit(onReady)'); triggerExit(onReady) }, 650)
return () => { console.log('[splash] ringFull effect cleanup — cancelling timeout'); clearTimeout(t) }
})
function submitPin() {
+1 -1
View File
@@ -19,7 +19,7 @@
const entries = $derived(
historyState.sessions
.filter((s, i, arr) => arr.findIndex(x => x.mangaId === s.mangaId) === i)
.slice(0, 10)
.slice(0, 5)
)
</script>
+2
View File
@@ -35,6 +35,8 @@ export const appState = $state({
history: [] as unknown[],
toasts: [] as unknown[],
appDir: '',
authUser: '',
authPass: '',
idleSplash: false,
devSplash: false,
})
+4 -14
View File
@@ -33,11 +33,8 @@ export async function initPlatform(): Promise<void> {
}
function pinLockEnabled(): boolean {
return (
settingsState.settings.appLockEnabled === true &&
typeof settingsState.settings.appLockPin === 'string' &&
settingsState.settings.appLockPin.length >= 4
)
const pin = settingsState.settings.appLockPin
return typeof pin === 'string' && pin.length >= 4
}
function handleProbeSuccess(gen: number) {
@@ -56,6 +53,7 @@ function handleAuthRequired(
pass: string,
) {
if (gen !== probeGeneration) return
if (boot.skipped) return
boot.failed = false
appState.authMode = authMode
@@ -93,13 +91,6 @@ export async function startProbe(
const baseUrl = settingsState.settings.serverUrl ?? 'http://127.0.0.1:4567'
configureAuth(baseUrl, authMode, user || undefined, pass || undefined)
if (appState.platform === 'web') {
boot.failed = true
appState.status = 'error'
startBackgroundProbe(gen, authMode, user, pass)
return
}
let tries = 0
async function probe() {
@@ -191,10 +182,9 @@ export function bypassBoot(
user = '',
pass = '',
) {
const gen = probeGeneration
boot.loginRequired = false
boot.sessionExpired = false
boot.skipped = true
appState.status = 'ready'
startBackgroundProbe(gen, authMode, user, pass)
startBackgroundProbe(probeGeneration, authMode, user, pass)
}