|
|
@@ -317,10 +317,15 @@ window.api.onMenuCommand((id) => {
|
|
|
listenForDeepLinks()
|
|
|
|
|
|
function LoadingSplash() {
|
|
|
+ const [elapsed, setElapsed] = createSignal(0)
|
|
|
+ onMount(() => {
|
|
|
+ const i = setInterval(() => setElapsed(e => e + 1), 1000)
|
|
|
+ return () => clearInterval(i)
|
|
|
+ })
|
|
|
return (
|
|
|
<div class="h-dvh w-screen flex flex-col items-center justify-center bg-background-base">
|
|
|
<Splash class="w-16 h-20 opacity-50 animate-pulse" />
|
|
|
- <span class="text-14-medium text-text-muted mt-4">正在启动 KirinCode</span>
|
|
|
+ <span class="text-13-medium text-text-muted mt-4">正在启动 KirinCode ({elapsed()}s)</span>
|
|
|
</div>
|
|
|
)
|
|
|
}
|
|
|
@@ -382,6 +387,15 @@ function DesktopRoot(props: { windowState: DesktopWindowState }) {
|
|
|
const ready = createMemo(
|
|
|
() => !defaultServer.loading && !sidecar.loading && !windowCount.loading && !locale.loading,
|
|
|
)
|
|
|
+ // Fallback: force loading complete after sidecar is ready + 10 seconds
|
|
|
+ const [forceReady, setForceReady] = createSignal(false)
|
|
|
+ createEffect(() => {
|
|
|
+ if (!sidecar.loading && sidecar.latest && !forceReady()) {
|
|
|
+ const t = setTimeout(() => setForceReady(true), 10000)
|
|
|
+ onCleanup(() => clearTimeout(t))
|
|
|
+ }
|
|
|
+ })
|
|
|
+ const effectiveReady = createMemo(() => ready() || forceReady())
|
|
|
const servers = createMemo(() => {
|
|
|
const data = initializationData(sidecar)
|
|
|
const list: ServerConnection.Any[] = []
|
|
|
@@ -404,7 +418,7 @@ function DesktopRoot(props: { windowState: DesktopWindowState }) {
|
|
|
ServerConnection.Key.make(availableStartupServer(defaultServer.latest, wslServers.data)),
|
|
|
)
|
|
|
return (
|
|
|
- <Show when={ready()} fallback={<LoadingSplash />}>
|
|
|
+ <Show when={effectiveReady()} fallback={<LoadingSplash />}>
|
|
|
<Show when={effectiveDefaultServer()} keyed>
|
|
|
{(key) => (
|
|
|
<AppInterface
|