Skip to content

Commit 48e17fa

Browse files
codynovaCody Persingerjoshuaellis
authored
chore(demos): resolve pmndrs#1642 Notification Hub demo cancelling messages after onRest (pmndrs#1643)
Co-authored-by: Cody Persinger <[email protected]> Co-authored-by: Josh <[email protected]>
1 parent 5c41aef commit 48e17fa

File tree

1 file changed

+2
-2
lines changed
  • demo/src/sandboxes/notification-hub/src

1 file changed

+2
-2
lines changed

demo/src/sandboxes/notification-hub/src/App.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ function MessageHub({
4848
})
4949
)
5050
},
51-
config: (item, index, phase) => key => (phase === 'enter' && key === 'life' ? { duration: timeout } : config),
51+
config: (item, index, phase) => key => phase === 'enter' && key === 'life' ? { duration: timeout } : config,
5252
})
5353

5454
useEffect(() => {
@@ -67,7 +67,7 @@ function MessageHub({
6767
<Button
6868
onClick={(e: MouseEvent) => {
6969
e.stopPropagation()
70-
if (cancelMap.has(item)) cancelMap.get(item)()
70+
if (cancelMap.has(item) && life.get() !== '0%') cancelMap.get(item)()
7171
}}>
7272
<X size={18} />
7373
</Button>

0 commit comments

Comments
 (0)