Skip to content

Commit

Permalink
fix(webui): keep previous data on modules
Browse files Browse the repository at this point in the history
  • Loading branch information
byCedric committed Aug 25, 2024
1 parent 0f17034 commit e9cb122
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion webui/src/app/(atlas)/[bundle]/modules/[path].tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useQuery } from '@tanstack/react-query';
import { keepPreviousData, useQuery } from '@tanstack/react-query';
import { useLocalSearchParams } from 'expo-router';

import { BreadcrumbLinks } from '~/components/BreadcrumbLinks';
Expand Down Expand Up @@ -65,6 +65,7 @@ function getModuleType(module: AtlasModule) {
function useModuleData(bundleId: string, path: string) {
return useQuery<AtlasModule>({
refetchOnWindowFocus: false,
placeholderData: keepPreviousData,
queryKey: [`bundles`, bundleId, `module`, path],
queryFn: async ({ queryKey }) => {
const [_key, bundle, _module, path] = queryKey as [string, string, string, string];
Expand Down

0 comments on commit e9cb122

Please sign in to comment.