| | |
| | | let isIndicatorRoute = $state(window.location.hash === '#/indicator') |
| | | let showUpdateDialog = $state(false) |
| | | let languageReady = $state(false) |
| | | let showOnboarding = $state(false) |
| | | |
| | | onMount(() => { |
| | | Call.ByName('voicesnap/services.ConfigService.GetLanguageSettings').then((settings: any) => { |
| | |
| | | const data = ev?.data |
| | | if (data?.status) { |
| | | engineStatus.set(data.status as any) |
| | | if (data.status === 'ready') { |
| | | showOnboarding = false |
| | | } |
| | | } |
| | | if (data?.hardwareInfo) { |
| | | engineHardwareInfo.set(data.hardwareInfo) |
| | |
| | | Call.ByName('voicesnap/services.EngineService.GetStatus').then((data: any) => { |
| | | if (data?.status) { |
| | | engineStatus.set(data.status as any) |
| | | if (data.status === 'ready') { |
| | | showOnboarding = false |
| | | } |
| | | } |
| | | if (data?.hardwareInfo) { |
| | | engineHardwareInfo.set(data.hardwareInfo) |
| | |
| | | try { |
| | | const current: any = await Call.ByName('voicesnap/services.EngineService.GetCurrentModelStatus') |
| | | if (!current?.installed) { |
| | | engineStatus.set('need_model') |
| | | const hasAnyInstalled: any = await Call.ByName('voicesnap/services.EngineService.HasAnyInstalledModel') |
| | | showOnboarding = !hasAnyInstalled |
| | | if (!hasAnyInstalled) { |
| | | engineStatus.set('need_model') |
| | | } |
| | | } else { |
| | | showOnboarding = false |
| | | } |
| | | } catch { |
| | | try { |
| | | const exists: any = await Call.ByName('voicesnap/services.EngineService.ModelExists') |
| | | if (!exists) { |
| | | engineStatus.set('need_model') |
| | | const hasAnyInstalled: any = await Call.ByName('voicesnap/services.EngineService.HasAnyInstalledModel') |
| | | .catch(() => false) |
| | | showOnboarding = !hasAnyInstalled |
| | | if (!hasAnyInstalled) { |
| | | engineStatus.set('need_model') |
| | | } |
| | | } |
| | | } catch {} |
| | | } |
| | |
| | | {:else} |
| | | {#if languageReady} |
| | | {#key $localeRevision} |
| | | {#if $engineStatus === 'need_model'} |
| | | {#if showOnboarding && $engineStatus === 'need_model'} |
| | | <OnboardingView /> |
| | | {:else} |
| | | <SettingsWindow /> |