move onboard to startup
Signed-off-by: FTCHD <144691102+FTCHD@users.noreply.github.com>
This commit is contained in:
+1
-1
@@ -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
@@ -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 })),
|
||||
|
||||
|
||||
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user