We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7ecba6d commit 7af409bCopy full SHA for 7af409b
src/client/notifications.ts
@@ -1,4 +1,7 @@
1
+import { ToastAction } from '@/components/ui/toast';
2
import { toast } from '@/components/ui/use-toast';
3
+import { createElement } from 'react';
4
+import { client } from './client';
5
6
export type RoomNotification = {
7
mentions: number;
@@ -41,6 +44,10 @@ class NotificationsEngine {
41
44
toast({
42
45
title,
43
46
description: limitString(notification.message, 150),
47
+ // action: <ToastAction altText="Try again">Try again</ToastAction>,
48
+ action: createElement(ToastAction, { altText: 'View', onClick: () => {
49
+ client.selectRoom(notification.room);
50
+ } }, 'View') as any,
51
});
52
}
53
} else {
0 commit comments