Skip to content

Commit

Permalink
fix router initialisation (#726)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkNerdi authored Sep 18, 2023
1 parent ff970b8 commit 14295a6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
4 changes: 1 addition & 3 deletions packages/desktop/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -73,18 +73,16 @@
features.analytics.appStart.enabled && Platform.trackEvent('app-start')
await cleanupEmptyProfiles()
checkAndMigrateProfiles()
Platform.onEvent('deep-link-request', handleDeepLink)
setTimeout(() => {
splash = false
initialiseRouters()
// check if deep link request was received while splash screen was active
Platform.DeepLinkManager.checkForDeepLinkRequest()
}, 3000)
initAppSettings.set($appSettings)
initialiseRouters()
initialiseRouterManager({
extensions: [
[RouterManagerExtensionName.GetAppRouter, getAppRouter],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
import { get } from 'svelte/store'

import { IRouterManager, IRouterManagerOptions } from '../interfaces'
import { routerManager } from '../stores'

export function initialiseRouterManager(options: IRouterManagerOptions): void {
if (get(routerManager)) {
throw new Error('Router manager has already been initialised.')
} else {
const { extensions } = options
const _routerManager = {
...Object.fromEntries(extensions),
}
routerManager.set(<IRouterManager>(<unknown>_routerManager))
const { extensions } = options
const _routerManager = {
...Object.fromEntries(extensions),
}
routerManager.set(<IRouterManager>(<unknown>_routerManager))
}

0 comments on commit 14295a6

Please sign in to comment.