mirror of
https://github.com/supabase/supabase.git
synced 2026-10-05 09:25:06 +03:00
Add check for vault is enabled before loading vault in databaseLayout
This commit is contained in:
1 parent
e03d5fd1f0
commit
a35f787559
1 file changed
+9
-1
@@ -22,6 +22,9 @@ const DatabaseLayout: FC<Props> = ({ title, children }) => {
|
||||
const router = useRouter()
|
||||
const page = router.pathname.split('/')[4]
|
||||
|
||||
const vaultExtension = meta.extensions.byId('supabase_vault')
|
||||
const isVaultEnabled = vaultExtension !== undefined && vaultExtension?.installed_version !== null
|
||||
|
||||
const [loaded, setLoaded] = useState<boolean>(isInitialized)
|
||||
|
||||
useEffect(() => {
|
||||
@@ -38,10 +41,15 @@ const DatabaseLayout: FC<Props> = ({ title, children }) => {
|
||||
if (IS_PLATFORM) {
|
||||
backups.load()
|
||||
}
|
||||
vault.load()
|
||||
}
|
||||
}, [ui.selectedProject?.ref])
|
||||
|
||||
useEffect(() => {
|
||||
if (isVaultEnabled) {
|
||||
vault.load()
|
||||
}
|
||||
}, [ui.selectedProject?.ref, isVaultEnabled])
|
||||
|
||||
// Optimization required: load logic should be at the page level
|
||||
// e.g backups page is waiting for meta.tables to load finish when it doesnt even need that data
|
||||
useEffect(() => {
|
||||
|
||||
Reference in new issue
Block a user