Skip to content

Commit

Permalink
Revert #491 37b519b now that apollo bug has been fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
CarsonF committed Jan 20, 2021
1 parent 0d140e1 commit 68eaa9d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
8 changes: 1 addition & 7 deletions src/components/files/FileActions/FileVersions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,9 @@ export const FileVersions: FC<FileVersionsProps> = (props) => {
const classes = useStyles();

const id = file?.id ?? '';
const shouldSkipQuery = !file;
const { data, loading } = useQuery(FileVersionsDocument, {
variables: { id },
// Workaround for a known bug in Apollo client that causes
// `skip` to suddenly be ignored when `client.resetStore` is
// called:
// https://github.com/apollographql/react-apollo/issues/3492#issuecomment-622573677
fetchPolicy: shouldSkipQuery ? 'cache-only' : 'cache-first',
skip: shouldSkipQuery,
skip: !file,
});

const total = data?.file.children.total;
Expand Down
8 changes: 1 addition & 7 deletions src/scenes/Projects/Files/ProjectFilesList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,17 +126,11 @@ const ProjectFilesListWrapped: FC = () => {

const isNotRootDirectory = directoryId !== rootDirectoryId;

const shouldSkipQuery = !directoryId;
const { data, loading, error } = useQuery(ProjectDirectoryDocument, {
variables: {
id: directoryId,
},
// Workaround for a known bug in Apollo client that causes
// `skip` to suddenly be ignored when `client.resetStore` is
// called:
// https://github.com/apollographql/react-apollo/issues/3492#issuecomment-622573677
fetchPolicy: shouldSkipQuery ? 'cache-only' : 'cache-first',
skip: shouldSkipQuery,
skip: !directoryId,
});

// Don't wait for data to load table js code
Expand Down

0 comments on commit 68eaa9d

Please sign in to comment.