Remove optimistic client loading

This commit is contained in:
Jackson Harper
2024-08-13 14:26:58 +08:00
parent 3b57461efa
commit 801f075952
4 changed files with 1 additions and 32 deletions

View File

@ -35,7 +35,6 @@
"@tanstack/query-async-storage-persister": "^5.51.21",
"@tanstack/query-sync-storage-persister": "^5.51.21",
"@tanstack/react-query": "^5.51.21",
"@tanstack/react-query-persist-client": "^5.51.21",
"allotment": "^1.20.2",
"antd": "4.24.3",
"axios": "^1.2.0",

View File

@ -31,26 +31,6 @@ import React from 'react'
const queryClient = new QueryClient()
if (typeof window !== 'undefined') {
const localStoragePersister = createAsyncStoragePersister({
storage: window.localStorage,
})
persistQueryClient({
queryClient,
persister: localStoragePersister,
// one week cache time
maxAge: 7 * 24 * 60 * 60 * 1000,
dehydrateOptions: {
shouldDehydrateQuery: ({ queryKey }) => {
// Don't cache the library items in local storage
const [firstKey] = queryKey
return firstKey !== 'library-items' && firstKey !== 'shortcuts'
},
},
})
}
TopBarProgress.config({
barColors: {
'0': '#FFD234',

View File

@ -72,10 +72,7 @@ export default function Shortcuts(): JSX.Element {
return (
<SettingsLayout>
{!isLoading &&
shortcutIds.map((shortcutId) => {
return <Box key={shortcutId}>{shortcutId}</Box>
})}
<SavedSearches shortcutIds={shortcutIds} />
</SettingsLayout>
)
}

View File

@ -7602,13 +7602,6 @@
"@tanstack/query-core" "5.51.21"
"@tanstack/query-persist-client-core" "5.51.21"
"@tanstack/react-query-persist-client@^5.51.21":
version "5.51.23"
resolved "https://registry.yarnpkg.com/@tanstack/react-query-persist-client/-/react-query-persist-client-5.51.23.tgz#f4f4d7ba854907c43a864614eea94579a20f0651"
integrity sha512-SwTNwxhG4zgpji3B8oLZqZuaOXYtOjbuqVerMQkOX/vGroIU6dGh1SzOwy4glW3IVr+G3kUKMcS3JYibWPQZiQ==
dependencies:
"@tanstack/query-persist-client-core" "5.51.21"
"@tanstack/react-query@^5.51.21":
version "5.51.23"
resolved "https://registry.yarnpkg.com/@tanstack/react-query/-/react-query-5.51.23.tgz#83c223f4cb6054b206de8856b73ca7e41a63ba1f"