Hi,
there is hardcoded TOAST_ID starting always at 1LN
Case: you make a toast, it gets id: 1, you get in Notification center notification with id: 1 and sync it to localStorage. Then you refresh browser and rehydrate Notification center from localStorage. You still have persisted notification with id: 1. You make a new toast and it gets again id: 1, you get it in Notification center where it overrides the previously stored notification with same id.
My workaround is, that I am storing notifications, with new ids. But I am not sure if that was intended, it would be more consistent to store original ids.
Solution - simple one fe. add another argument - toastIdUpdate? to useNotificationCenter function, which would update default TOAST_ID. More complicated - find last id in data passed for rehydratation.
Hi, there is hardcoded
TOAST_ID
starting always at1
LNCase: you make a toast, it gets
id: 1
, you get in Notification center notification withid: 1
and sync it to localStorage. Then you refresh browser and rehydrate Notification center from localStorage. You still have persisted notification withid: 1
. You make a new toast and it gets againid: 1
, you get it in Notification center where it overrides the previously stored notification with same id.My workaround is, that I am storing notifications, with new ids. But I am not sure if that was intended, it would be more consistent to store original ids.
Solution - simple one fe. add another argument - toastIdUpdate? to useNotificationCenter function, which would update default TOAST_ID. More complicated - find last id in data passed for rehydratation.
I am willing to make PR, but to busy right now.