Combine recent raised hands into existing toast

This commit is contained in:
ayumi-signal 2024-01-12 19:44:44 -08:00 committed by GitHub
parent b0b12d4224
commit b574ba531d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 60 additions and 31 deletions

View file

@ -32,6 +32,7 @@ export type CallingToastType = {
content: JSX.Element | string;
autoClose: boolean;
dismissable?: boolean;
lifetime?: number;
} & (
| {
// key must be provided if the toast is 'only-show-once'
@ -161,7 +162,7 @@ export function CallingToastProvider({
}
if (toast.autoClose) {
startTimer(key, lifetime);
startTimer(key, toast.lifetime ?? lifetime);
nonPersistentToasts.unshift({ ...toast, key });
} else {
persistentToasts.unshift({ ...toast, key });