diff options
author | Paul Frazee <pfrazee@gmail.com> | 2023-11-29 11:15:35 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-29 11:15:35 -0800 |
commit | 4b3ec54add3ddc4b6fc3a0045977c692bdb1842f (patch) | |
tree | 363dc6c6d6f885e0ec8252099fa1d2fc4d3c8169 /src/view/shell | |
parent | 9239efac9c5339093f2742099b33834053635fc9 (diff) | |
download | voidsky-4b3ec54add3ddc4b6fc3a0045977c692bdb1842f.tar.zst |
Fix infinite query reloading behavior (reset, not invalidate) (#2031)
* Reset, not invalidate, notification queries * Reset, not invalidate, feed queries
Diffstat (limited to 'src/view/shell')
-rw-r--r-- | src/view/shell/Drawer.tsx | 2 | ||||
-rw-r--r-- | src/view/shell/bottom-bar/BottomBar.tsx | 2 | ||||
-rw-r--r-- | src/view/shell/desktop/LeftNav.tsx | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/src/view/shell/Drawer.tsx b/src/view/shell/Drawer.tsx index 9df9b70b3..b2bb6ea1e 100644 --- a/src/view/shell/Drawer.tsx +++ b/src/view/shell/Drawer.tsx @@ -141,7 +141,7 @@ export function DrawerContent() { } else { if (tab === 'Notifications') { // fetch new notifs on view - queryClient.invalidateQueries({ + queryClient.resetQueries({ queryKey: NOTIFS_RQKEY(), }) } diff --git a/src/view/shell/bottom-bar/BottomBar.tsx b/src/view/shell/bottom-bar/BottomBar.tsx index dfb18cc4a..a97ff8afc 100644 --- a/src/view/shell/bottom-bar/BottomBar.tsx +++ b/src/view/shell/bottom-bar/BottomBar.tsx @@ -62,7 +62,7 @@ export function BottomBar({navigation}: BottomTabBarProps) { } else { if (tab === 'Notifications') { // fetch new notifs on view - queryClient.invalidateQueries({ + queryClient.resetQueries({ queryKey: NOTIFS_RQKEY(), }) } diff --git a/src/view/shell/desktop/LeftNav.tsx b/src/view/shell/desktop/LeftNav.tsx index a0052e0ca..8daa381d5 100644 --- a/src/view/shell/desktop/LeftNav.tsx +++ b/src/view/shell/desktop/LeftNav.tsx @@ -150,7 +150,7 @@ function NavItem({count, href, icon, iconFilled, label}: NavItemProps) { } else { if (href === '/notifications') { // fetch new notifs on view - queryClient.invalidateQueries({ + queryClient.resetQueries({ queryKey: NOTIFS_RQKEY(), }) } |