fix(web): reset infinite scroll when notification filters change

This commit is contained in:
Pujit Mehrotra
2024-11-20 12:17:17 -05:00
parent eeb3289ae8
commit 3fe13d5235

View File

@@ -21,7 +21,13 @@ const props = withDefaults(
} }
); );
/** whether we should continue trying to load more notifications */
const canLoadMore = ref(true); const canLoadMore = ref(true);
/** reset custom state when props (e.g. props.type filter) change*/
watch(props, () => {
canLoadMore.value = true;
});
const { result, error, fetchMore } = useQuery(getNotifications, () => ({ const { result, error, fetchMore } = useQuery(getNotifications, () => ({
filter: { filter: {
offset: 0, offset: 0,