Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I added tags to toasts in #749 for UX reasons. They work similar to how we merge push notifications in the service worker. So 2x
subscribed
becomes 1x(2) subscribed
. This behavior is enabled by default since the body of a toast will be used as the tag by default and since I think this always makes sense to declutter the UI.I figured that having this as a dedicated PR is easier to review. I will rebase #749 on this PR.
This also includes being able to attach an
onCancel
function to a toast. If a toast contains anonCancel
function, it will not be closed on page navigation. This was also added in #749 to cancel async zaps (NWC) and can also be used to cancel custodial zaps in the near future, too.Since toasts can have
onCancel
and the same tag (for example by simply having the same body), theonCancel
of the most recent toast is shown. It that one is closed, the next uncanceled toast with same tag is shown.I think that's better UX then the other way around (show
onCancel
of oldest toast with same tag) since you usually want to cancel your latest action.2024-02-01.15-40-19.mp4