Skip to content
This repository was archived by the owner on Jun 11, 2024. It is now read-only.

Commit 7687033

Browse files
committed
context.window 구조 분해 할당시 버그 수정
1 parent 8d5cb19 commit 7687033

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

app/modules/general/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@ import { configStore } from '@app/stores/config';
55

66
export type AppControlAction = 'devtools' | 'minimize' | 'maximize' | 'close';
77

8-
const GeneralModule: ModuleFunction = ({ window }) => {
8+
const GeneralModule: ModuleFunction = context => {
99
// 창 닫기, 최대화, 최소화 같은 컨트롤 기능
1010
ipcMain.on('appControl', async (_, action: AppControlAction) => {
11+
const { window } = context;
12+
1113
if (!window) return;
1214

1315
switch (action) {

app/modules/update/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export type UpdateEvent =
1919
| 'download-progress'
2020
| 'update-downloaded';
2121

22-
const UpdateModule: ModuleFunction = ({ window }) => {
22+
const UpdateModule: ModuleFunction = context => {
2323
const handleUpdateEvent = (event: UpdateEvent) => {
2424
return (data?: any) => {
2525
if (event !== 'download-progress') {
@@ -30,8 +30,8 @@ const UpdateModule: ModuleFunction = ({ window }) => {
3030
});
3131
}
3232

33-
if (window) {
34-
window.webContents.send('update', event, data);
33+
if (context.window) {
34+
context.window.webContents.send('update', event, data);
3535
}
3636
};
3737
};

0 commit comments

Comments
 (0)