mirror of
https://github.com/nocodb/nocodb.git
synced 2026-02-01 23:38:21 +00:00
Merge pull request #12954 from nocodb/nc-fix/ui-bug
fix: Lazy loaded component related issue
This commit is contained in:
@@ -45,7 +45,15 @@ const handleDownload = async (url: string) => {
|
||||
|
||||
const isExporting = ref(false)
|
||||
|
||||
const { sorts, nestedFilters, isLocked } = useSmartsheetStoreOrThrow()
|
||||
/**
|
||||
* This component is lazy loaded and might be initialized after the view is effectively unmounted.
|
||||
* In that case, the store is not available anymore, so we need to provide a fallback to avoid a crash.
|
||||
*/
|
||||
const { sorts, nestedFilters, isLocked } = useSmartsheetStore() || {
|
||||
sorts: ref([]),
|
||||
nestedFilters: ref([]),
|
||||
isLocked: ref(false),
|
||||
}
|
||||
const { isUIAllowed } = useRoles()
|
||||
|
||||
const exportFile = async (exportType: ExportTypes) => {
|
||||
|
||||
@@ -272,7 +272,7 @@ const [useProvideSmartsheetStore, useSmartsheetStore] = useInjectionState(
|
||||
'smartsheet-store',
|
||||
)
|
||||
|
||||
export { useProvideSmartsheetStore }
|
||||
export { useProvideSmartsheetStore, useSmartsheetStore }
|
||||
|
||||
export function useSmartsheetStoreOrThrow() {
|
||||
const state = useSmartsheetStore()
|
||||
|
||||
Reference in New Issue
Block a user