File tree Expand file tree Collapse file tree
packages/workshop-app/app/routes/admin+ Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,6 +22,8 @@ const NOTIFICATIONS: Array<Notification> = [
2222]
2323
2424export async function getUnmutedNotifications ( ) {
25+ if ( ENV . EPICSHOP_DEPLOYED ) return [ ]
26+
2527 const muted = await getMutedNotifications ( )
2628
2729 const visibleNotifications = NOTIFICATIONS . filter ( ( n ) => {
Original file line number Diff line number Diff line change @@ -26,10 +26,15 @@ export function Notifications({
2626} ) {
2727 const fetcher = useFetcher < typeof action > ( )
2828 const fetcherRef = useRef ( fetcher )
29+ const toastedIds = useRef < Set < string > > ( new Set ( ) )
2930
3031 useEffect ( ( ) => {
3132 for ( const notification of unmutedNotifications ) {
33+ if ( toastedIds . current . has ( notification . id ) ) continue
34+ toastedIds . current . add ( notification . id )
35+
3236 toast . info ( notification . title , {
37+ id : notification . id ,
3338 description : (
3439 < div >
3540 < p > { notification . message } </ p >
You can’t perform that action at this time.
0 commit comments