Skip to content

Commit 033fabd

Browse files
committed
Now, after clicking on save you can't use 'save'again without make changes
1 parent 1a31ba6 commit 033fabd

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

apps/meteor/client/views/room/contextualBar/NotificationPreferences/NotificationPreferences.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,15 @@ const NotificationPreferences = ({
3232
const { t } = useTranslation();
3333
const {
3434
formState: { isDirty, isSubmitting },
35+
reset,
36+
getValues,
3537
} = useFormContext();
3638

39+
function handleSaveHandler() {
40+
handleSave();
41+
reset(getValues());
42+
}
43+
3744
return (
3845
<>
3946
<ContextualbarHeader>
@@ -47,7 +54,7 @@ const NotificationPreferences = ({
4754
<ContextualbarFooter>
4855
<ButtonGroup stretch>
4956
{handleClose && <Button onClick={handleClose}>{t('Cancel')}</Button>}
50-
<Button primary disabled={!isDirty} loading={isSubmitting} onClick={handleSave}>
57+
<Button primary disabled={!isDirty} loading={isSubmitting} onClick={handleSaveHandler}>
5158
{t('Save')}
5259
</Button>
5360
</ButtonGroup>

0 commit comments

Comments
 (0)