Skip to content

Commit

Permalink
Fix setRegionToRecord and showCancel button on record fail popup
Browse files Browse the repository at this point in the history
  • Loading branch information
IRHM committed Dec 27, 2023
1 parent c4e4280 commit 9996a38
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/libs/recorder/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ ipcRenderer.on("startStopRecordingSavedRegion-pressed", async () => {
Notifications.popup({
id: "CANT-RECORD-SR",
title: "Can't Record Saved Region!",
message: "A width and or height has not been provided in settings!"
message: "A width and or height has not been provided in settings!",
showCancel: true
}).catch((err) => logger.error("Recorder", "Failed to show CANT-RECORD-SR popup", err));
return;
}
Expand Down
8 changes: 4 additions & 4 deletions src/settings/settingsSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@ const settingsSlice = createSlice({
state.recording.hardwareEncoding = action.payload;
},
setRegionToRecord(state, action: PayloadAction<{ x?: number; y?: number; width?: number; height?: number }>) {
if (action.payload.x) state.recording.regionToRecord.x = action.payload.x;
if (action.payload.y) state.recording.regionToRecord.y = action.payload.y;
if (action.payload.width) state.recording.regionToRecord.width = action.payload.width;
if (action.payload.height) state.recording.regionToRecord.height = action.payload.height;
if (typeof action.payload.x === "number") state.recording.regionToRecord.x = action.payload.x;
if (typeof action.payload.y === "number") state.recording.regionToRecord.y = action.payload.y;
if (typeof action.payload.width === "number") state.recording.regionToRecord.width = action.payload.width;
if (typeof action.payload.height === "number") state.recording.regionToRecord.height = action.payload.height;
},

//
Expand Down

0 comments on commit 9996a38

Please sign in to comment.