headless fetchNotifications() overfetches on multiple calls
I'm using the headless library to power a component that has 2 states, all notifications and unread only. It all works fine on initial load but if I change the state (and make another call to fetchNotifications) then there seems to be a feedback loop where the data gets fetched for both cases multiple times.
I've tried unsubscribing after receiving a notifications response which does stop the refetching but then I can no longer listen for unseen notifications.
NOTE: The example on the novu-headless-demo has an await for the fetchNotification call but fetchNotification returns no promise so it doesn't quite work 1:1, no idea if this is related
I've tried unsubscribing after receiving a notifications response which does stop the refetching but then I can no longer listen for unseen notifications.
NOTE: The example on the novu-headless-demo has an await for the fetchNotification call but fetchNotification returns no promise so it doesn't quite work 1:1, no idea if this is related