File tree Expand file tree Collapse file tree
packages/workshop-app/app Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -138,7 +138,7 @@ export async function loader({ request }: LoaderFunctionArgs) {
138138 if (
139139 repoUpdates &&
140140 repoUpdates . remoteCommit &&
141- mutedNotifications . includes ( repoUpdates . remoteCommit )
141+ mutedNotifications . includes ( `update-repo- ${ repoUpdates . remoteCommit } ` )
142142 ) {
143143 repoUpdates = { ...repoUpdates , updatesAvailable : false }
144144 }
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ export async function action({ request }: { request: Request }) {
1515 const id = formData . get ( 'id' )
1616
1717 if ( intent === 'dismiss' && typeof id === 'string' ) {
18- await muteNotification ( id )
18+ await muteNotification ( `update-repo- ${ id } ` )
1919 return json ( { type : 'dismissed' } as const )
2020 }
2121
@@ -59,6 +59,8 @@ export function UpdateToast({
5959} ) {
6060 const updateFetcher = useFetcher < typeof action > ( )
6161 const updateFetcherRef = useRef ( updateFetcher )
62+ const dismissFetcher = useFetcher < typeof action > ( )
63+ const dismissFetcherRef = useRef ( dismissFetcher )
6264 const { updatesAvailable, diffLink, remoteCommit } = repoUpdates
6365
6466 useEffect ( ( ) => {
@@ -84,7 +86,7 @@ export function UpdateToast({
8486 const formData = new FormData ( )
8587 formData . append ( 'intent' , 'dismiss' )
8688 formData . append ( 'id' , remoteCommit )
87- updateFetcherRef . current . submit ( formData , {
89+ dismissFetcherRef . current . submit ( formData , {
8890 method : 'post' ,
8991 action : '/admin/update-repo' ,
9092 } )
You can’t perform that action at this time.
0 commit comments