Skip to content

Commit

Permalink
fix: migration loading indicator (janhq#1913)
Browse files Browse the repository at this point in the history
  • Loading branch information
louis-jan authored Feb 3, 2024
1 parent afa80b9 commit 6ea7d8f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion web/containers/Providers/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import {

import Umami from '@/utils/umami'

import Loader from '../Loader'

import KeyListener from './KeyListener'

import { extensionManager } from '@/extension'
Expand All @@ -30,18 +32,21 @@ const Providers = (props: PropsWithChildren) => {

const [setupCore, setSetupCore] = useState(false)
const [activated, setActivated] = useState(false)
const [settingUp, setSettingUp] = useState(false)

async function setupExtensions() {
// Register all active extensions
await extensionManager.registerActive()

setTimeout(async () => {
if (!isCoreExtensionInstalled()) {
setupBaseExtensions()
setSettingUp(true)
await setupBaseExtensions()
return
}

extensionManager.load()
setSettingUp(false)
setActivated(true)
}, 500)
}
Expand Down Expand Up @@ -71,6 +76,7 @@ const Providers = (props: PropsWithChildren) => {
<JotaiWrapper>
<ThemeWrapper>
<Umami />
{settingUp && <Loader description="Preparing Update..." />}
{setupCore && activated && (
<KeyListener>
<FeatureToggleWrapper>
Expand Down

0 comments on commit 6ea7d8f

Please sign in to comment.