Skip to content

Commit

Permalink
fix(favorites): closed snackbar on link click
Browse files Browse the repository at this point in the history
  • Loading branch information
ruddenchaux committed Apr 18, 2021
1 parent 703be11 commit 4ec5c03
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/components/favorites/FavoriteSnackbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,14 @@ function SnackbarMessage({ action, entityName, entityType, favoritePath }: Favor
return (
<span data-cy="favorite-snackbar-message">
{entityName} {entityType} added to the{' '}
<Link component={RouterLink} to={favoritePath} onClick={() => dispatch(setDialogOpen(false))}>
<Link
component={RouterLink}
to={favoritePath}
onClick={() => {
dispatch(setDialogOpen(false));
dispatch(setSnackbar({ open: false }));
}}
>
favorites
</Link>
</span>
Expand Down

0 comments on commit 4ec5c03

Please sign in to comment.