Skip to content

Commit

Permalink
Fix cancelled query error, closes #37
Browse files Browse the repository at this point in the history
  • Loading branch information
sitek94 committed Dec 12, 2020
1 parent 6c19e6d commit 9cf7563
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/screens/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,16 @@ function DashboardScreen() {

const error = habitsError || checkmarksError;

/**
* Temporary fix
*
* Cancelled query is throwing `CancelledError`. In V3 cancellation will not throw an error anymore.
* https://github.com/tannerlinsley/react-query/discussions/1179
*/
const isCancelledError = checkmarksError && checkmarksError.hasOwnProperty('silent');

// Ignore cancelled errors
if (error && checkmarksError.constructor.name !== 'CancelledError') {
if (error && !isCancelledError) {
return <FullPageErrorFallback error={error} />;
}

Expand Down

0 comments on commit 9cf7563

Please sign in to comment.