Skip to content

Commit 27e0782

Browse files
fix:prettier
1 parent 6c515a5 commit 27e0782

File tree

295 files changed

+18028
-16249
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

295 files changed

+18028
-16249
lines changed

electron/electron-env.d.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
declare namespace NodeJS {
44
interface ProcessEnv {
5-
VSCODE_DEBUG?: 'true'
6-
DIST_ELECTRON: string
7-
DIST: string
5+
VSCODE_DEBUG?: 'true';
6+
DIST_ELECTRON: string;
7+
DIST: string;
88
/** /dist/ or /public/ */
9-
VITE_PUBLIC: string
9+
VITE_PUBLIC: string;
1010
}
11-
}
11+
}

electron/fs/deleteAllFilesInDir.js

+8-10
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,13 @@ import fs from 'fs/promises';
22
import path from 'path';
33

44
export default async function deleteAllFilesInDir(dirPath) {
5-
try {
6-
const files = await fs.readdir(dirPath);
5+
try {
6+
const files = await fs.readdir(dirPath);
77

8-
const deleteFilePromises = files.map(file =>
9-
fs.unlink(path.join(dirPath, file)),
10-
);
8+
const deleteFilePromises = files.map((file) => fs.unlink(path.join(dirPath, file)));
119

12-
await Promise.all(deleteFilePromises);
13-
} catch (err) {
14-
console.log(err);
15-
}
16-
};
10+
await Promise.all(deleteFilePromises);
11+
} catch (err) {
12+
console.log(err);
13+
}
14+
}

electron/main/events/index.js

+35-33
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,38 @@
11
import { BrowserWindow, powerMonitor } from 'electron';
22

33
export default function startEvents(ipcMain, newWin, appShow) {
4-
5-
ipcMain.on('set-title', (event, title) => {
6-
const webContents = event.sender;
7-
const tinyWin = BrowserWindow.fromWebContents(webContents);
8-
if (tinyWin) tinyWin.setTitle(title);
9-
});
10-
11-
ipcMain.on('tiny-focus-window', (event) => {
12-
const webContents = event.sender;
13-
const tinyWin = BrowserWindow.fromWebContents(webContents);
14-
if (tinyWin) setTimeout(() => { tinyWin.show(); tinyWin.focus(); }, 200);
15-
});
16-
17-
ipcMain.on('systemIdleTime', () => {
18-
const idleSecs = powerMonitor.getSystemIdleTime();
19-
newWin.webContents.send('systemIdleTime', idleSecs);
20-
});
21-
22-
ipcMain.on('systemIdleState', (event, value) => {
23-
const idleSecs = powerMonitor.getSystemIdleState(value);
24-
newWin.webContents.send('systemIdleState', idleSecs);
25-
});
26-
27-
ipcMain.on('openDevTools', () => {
28-
newWin.webContents.openDevTools();
29-
});
30-
31-
ipcMain.on('windowIsVisible', (event, isVisible) => {
32-
newWin[!isVisible ? 'hide' : 'show']();
33-
appShow.change((isVisible === true));
34-
});
35-
36-
};
4+
ipcMain.on('set-title', (event, title) => {
5+
const webContents = event.sender;
6+
const tinyWin = BrowserWindow.fromWebContents(webContents);
7+
if (tinyWin) tinyWin.setTitle(title);
8+
});
9+
10+
ipcMain.on('tiny-focus-window', (event) => {
11+
const webContents = event.sender;
12+
const tinyWin = BrowserWindow.fromWebContents(webContents);
13+
if (tinyWin)
14+
setTimeout(() => {
15+
tinyWin.show();
16+
tinyWin.focus();
17+
}, 200);
18+
});
19+
20+
ipcMain.on('systemIdleTime', () => {
21+
const idleSecs = powerMonitor.getSystemIdleTime();
22+
newWin.webContents.send('systemIdleTime', idleSecs);
23+
});
24+
25+
ipcMain.on('systemIdleState', (event, value) => {
26+
const idleSecs = powerMonitor.getSystemIdleState(value);
27+
newWin.webContents.send('systemIdleState', idleSecs);
28+
});
29+
30+
ipcMain.on('openDevTools', () => {
31+
newWin.webContents.openDevTools();
32+
});
33+
34+
ipcMain.on('windowIsVisible', (event, isVisible) => {
35+
newWin[!isVisible ? 'hide' : 'show']();
36+
appShow.change(isVisible === true);
37+
});
38+
}

electron/main/events/resize.js

+16-18
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,22 @@
11
export default function startResizeEvents(ipcMain, newWin) {
2+
// Resize
3+
const resizeWindowEvent = function () {
4+
newWin.webContents.send('resize', newWin.getSize());
5+
};
26

3-
// Resize
4-
const resizeWindowEvent = function () {
5-
newWin.webContents.send('resize', newWin.getSize());
6-
};
7+
newWin.on('resize', resizeWindowEvent);
8+
newWin.on('resized', resizeWindowEvent);
9+
newWin.on('will-resize', resizeWindowEvent);
710

8-
newWin.on('resize', resizeWindowEvent);
9-
newWin.on('resized', resizeWindowEvent);
10-
newWin.on('will-resize', resizeWindowEvent);
11+
newWin.on('maximize', resizeWindowEvent);
12+
newWin.on('unmaximize', resizeWindowEvent);
1113

12-
newWin.on('maximize', resizeWindowEvent);
13-
newWin.on('unmaximize', resizeWindowEvent);
14+
newWin.on('minimize', resizeWindowEvent);
15+
newWin.on('restore', resizeWindowEvent);
1416

15-
newWin.on('minimize', resizeWindowEvent);
16-
newWin.on('restore', resizeWindowEvent);
17+
newWin.on('enter-full-screen', resizeWindowEvent);
18+
newWin.on('leave-full-screen', resizeWindowEvent);
1719

18-
newWin.on('enter-full-screen', resizeWindowEvent);
19-
newWin.on('leave-full-screen', resizeWindowEvent);
20-
21-
newWin.on('enter-html-full-screen', resizeWindowEvent);
22-
newWin.on('leave-html-full-screen', resizeWindowEvent);
23-
24-
};
20+
newWin.on('enter-html-full-screen', resizeWindowEvent);
21+
newWin.on('leave-html-full-screen', resizeWindowEvent);
22+
}

0 commit comments

Comments
 (0)