Skip to content

Commit

Permalink
Merge pull request #663 from karelhala/time-config-cancel
Browse files Browse the repository at this point in the history
Fix time config cancel
  • Loading branch information
fhlavac authored Jan 14, 2025
2 parents 79ca994 + 7f75ac2 commit ce29a99
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/components/Notifications/TimeConfig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,9 @@ export const TimeConfigComponent: React.FunctionComponent = () => {
const handleButtonSave = React.useCallback(() => {
if (timeSelect) {
setTimeConfig(`${timeSelect.utcTime}:00`)
.then(() => {
.then(async () => {
addSuccessNotification('Action settings saved', '');
setTimePref(await getTimeConfig());
})
.catch(() => {
addDangerNotification('Failed to save action settings', '');
Expand All @@ -163,6 +164,13 @@ export const TimeConfigComponent: React.FunctionComponent = () => {

const handleModalToggle = () => {
setIsModalOpen(!isModalOpen);
if (timePref) {
setTimeSelect({
baseCustomTime: timePref,
utcTime: timePref,
timezoneText: undefined,
});
}
};

return (
Expand Down

0 comments on commit ce29a99

Please sign in to comment.