Skip to content

Commit

Permalink
fix: Reset success message when closing dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
josebui committed Feb 14, 2024
1 parent 851a262 commit 55e56be
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/sharedData/components/SharedDataEntryFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,15 @@ const ShareDialog = props => {
[onUpdateSharedResource, sharedResource]
);

const onCloseWrapper = useCallback(() => {
setShowUpdateSuccess(false);
handleClose();
}, [handleClose]);

return (
<Dialog
open={open}
onClose={handleClose}
onClose={onCloseWrapper}
aria-labelledby="share-file-dialog-title"
fullWidth
maxWidth="sm"
Expand All @@ -199,7 +204,7 @@ const ShareDialog = props => {
</Typography>
<IconButton
ref={onCloseRefChange}
onClick={handleClose}
onClick={onCloseWrapper}
sx={{ ml: 3 }}
aria-label={t('sharedData.share_file_dialog_close')}
>
Expand Down Expand Up @@ -273,7 +278,7 @@ const ShareDialog = props => {
) : (
<div />
)}
<Button variant="outlined" onClick={handleClose}>
<Button variant="outlined" onClick={onCloseWrapper}>
{t('sharedData.share_file_dialog_share_access_done')}
</Button>
</DialogActions>
Expand Down

0 comments on commit 55e56be

Please sign in to comment.