Skip to content

Commit

Permalink
fix: notification type selection issue in settings
Browse files Browse the repository at this point in the history
fix #368, #369 and re #343
  • Loading branch information
roldanjr committed Jul 3, 2023
1 parent c8c3c66 commit 04ddca1
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions app/renderer/src/routes/Settings/FeatureSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
AppStateTypes,
setEnableProgressAnimation,
SettingTypes,
setNotificationProperty,
setNotificationType,
setEnableFullscreenBreak,
setUseNativeTitlebar,
setAutoStartWorkTime,
Expand Down Expand Up @@ -130,7 +130,7 @@ const FeatureSection: React.FC = () => {

const onChangeNotificationProps = useCallback(
(e: React.ChangeEvent<HTMLInputElement>) => {
dispatch(setNotificationProperty(e.target.value));
dispatch(setNotificationType(e.target.value));
},
[dispatch]
);
Expand Down
4 changes: 2 additions & 2 deletions app/renderer/src/routes/Timer/Control/Control.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
skipTimer,
SPECIAL_BREAK,
STAY_FOCUS,
togglenotificationSoundOn,
toggleNotificationSound,
} from "store";
import {
StyledControl,
Expand Down Expand Up @@ -82,7 +82,7 @@ const Control: React.FC<Props> = ({ resetTimerAction }) => {
]);

const onNotifacationSoundCallback = useCallback(() => {
dispatch(togglenotificationSoundOn());
dispatch(toggleNotificationSound());
}, [dispatch]);

const onToggleCompactCallback = useCallback(() => {
Expand Down
8 changes: 4 additions & 4 deletions app/renderer/src/store/settings/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const setAlwaysOnTop = (
};
};

export const togglenotificationSoundOn = () => {
export const toggleNotificationSound = () => {
return {
type: TOGGLE_NOTIFICATION_SOUND,
};
Expand Down Expand Up @@ -95,12 +95,12 @@ export const setUseNativeTitlebar = (
};
};

export const setNotificationProperty = (
notificationProperty: string
export const setNotificationType = (
notificationType: string
): SettingActionTypes => {
return {
type: SET_NOTIFICATION_PROPERTY,
payload: notificationProperty,
payload: notificationType,
};
};

Expand Down
2 changes: 1 addition & 1 deletion app/renderer/src/store/settings/reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export const settingReducer = (
case SET_NOTIFICATION_PROPERTY:
return {
...state,
notificationProperty: action.payload,
notificationType: action.payload,
};
case CLOSE_TO_TRAY:
return {
Expand Down

0 comments on commit 04ddca1

Please sign in to comment.