fix: migration loading indicator (#1913)
This commit is contained in:
parent
afa80b92a3
commit
6ea7d8f6cf
@ -21,6 +21,8 @@ import {
|
||||
|
||||
import Umami from '@/utils/umami'
|
||||
|
||||
import Loader from '../Loader'
|
||||
|
||||
import KeyListener from './KeyListener'
|
||||
|
||||
import { extensionManager } from '@/extension'
|
||||
@ -30,6 +32,7 @@ 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
|
||||
@ -37,11 +40,13 @@ const Providers = (props: PropsWithChildren) => {
|
||||
|
||||
setTimeout(async () => {
|
||||
if (!isCoreExtensionInstalled()) {
|
||||
setupBaseExtensions()
|
||||
setSettingUp(true)
|
||||
await setupBaseExtensions()
|
||||
return
|
||||
}
|
||||
|
||||
extensionManager.load()
|
||||
setSettingUp(false)
|
||||
setActivated(true)
|
||||
}, 500)
|
||||
}
|
||||
@ -71,6 +76,7 @@ const Providers = (props: PropsWithChildren) => {
|
||||
<JotaiWrapper>
|
||||
<ThemeWrapper>
|
||||
<Umami />
|
||||
{settingUp && <Loader description="Preparing Update..." />}
|
||||
{setupCore && activated && (
|
||||
<KeyListener>
|
||||
<FeatureToggleWrapper>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user