move onboard to startup

Signed-off-by: FTCHD <144691102+FTCHD@users.noreply.github.com>
This commit is contained in:
FTCHD
2025-10-14 02:44:38 +02:00
parent 76a4afdec5
commit 00279fa985
3 changed files with 9 additions and 12 deletions
+1 -1
View File
@@ -30,7 +30,7 @@ export async function initRclone(args: string[]) {
// rclone not available, let's download it
if (!system && !internal) {
usePersistedStore.setState({ isFirstOpen: false })
useStore.setState({ startupDisplayed: true })
useStore.setState({ startupStatus: 'initializing' })
await openSmallWindow({
name: 'Startup',
+3 -6
View File
@@ -46,6 +46,8 @@ interface State {
| 'updated'
| 'error'
| 'fatal'
startupDisplayed: boolean
}
interface PersistedState {
@@ -91,9 +93,6 @@ interface PersistedState {
licenseValid: boolean
setLicenseValid: (valid: boolean) => void
isFirstOpen: boolean
setIsFirstOpen: (isFirstOpen: boolean) => void
startOnBoot: boolean
setStartOnBoot: (startOnBoot: boolean) => void
@@ -153,6 +152,7 @@ export const useStore = create<State>()(
set((state) => ({ remotes: state.remotes.filter((r) => r !== remote) })),
startupStatus: null,
startupDisplayed: false,
}),
{ name: 'shared-store' }
)
@@ -199,9 +199,6 @@ export const usePersistedStore = create<PersistedState>()(
licenseValid: false,
setLicenseValid: (valid: boolean) => set((_) => ({ licenseValid: valid })),
isFirstOpen: true,
setIsFirstOpen: (isFirstOpen: boolean) => set((_) => ({ isFirstOpen })),
startOnBoot: false,
setStartOnBoot: (startOnBoot: boolean) => set((_) => ({ startOnBoot })),
+5 -5
View File
@@ -357,15 +357,15 @@ async function startupMounts() {
}
}
async function onboardUser() {
const firstOpen = usePersistedStore.getState().isFirstOpen
if (firstOpen) {
async function showStartup() {
const startupDisplayed = useStore.getState().startupDisplayed
if (startupDisplayed) {
useStore.setState({ startupStatus: 'initialized' })
await openSmallWindow({
name: 'Startup',
url: '/startup',
})
usePersistedStore.setState({ isFirstOpen: false })
useStore.setState({ startupDisplayed: false })
}
}
@@ -649,7 +649,7 @@ checkTraySupport()
.then(() => validateInstance())
.then(() => checkAlreadyRunning())
.then(() => startRclone())
.then(() => onboardUser())
.then(() => showStartup())
.then(() => startupMounts())
.then(() => resumeTasks())
.then(() => showDefaultTray())