File tree 1 file changed +9
-5
lines changed
1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -21,9 +21,11 @@ const localStoragePersister = createAsyncStoragePersister({
21
21
key : cacheKey ,
22
22
} ) ;
23
23
24
- const isProjectsCacheEnabled = (
25
- window . __initialData ?. features as unknown as string [ ]
26
- ) ?. includes ( 'organizations:cache-projects-ui' ) ;
24
+ const isProjectsCacheEnabled =
25
+ window . indexedDB &&
26
+ ( window . __initialData ?. features as unknown as string [ ] ) ?. includes (
27
+ 'organizations:cache-projects-ui'
28
+ ) ;
27
29
28
30
/**
29
31
* Attach the persister to the query client
@@ -60,6 +62,8 @@ export function restoreQueryCache() {
60
62
}
61
63
62
64
export async function clearQueryCache ( ) {
63
- await localStoragePersister . removeClient ( ) ;
64
- await removeItem ( cacheKey ) ;
65
+ if ( isProjectsCacheEnabled ) {
66
+ await localStoragePersister . removeClient ( ) ;
67
+ await removeItem ( cacheKey ) ;
68
+ }
65
69
}
You can’t perform that action at this time.
0 commit comments