aboutsummaryrefslogtreecommitdiffstats
path: root/src/electron/ipc-api
diff options
context:
space:
mode:
authorLibravatar Markus Hatvan <markus_hatvan@aon.at>2021-09-14 19:58:52 +0200
committerLibravatar GitHub <noreply@github.com>2021-09-14 19:58:52 +0200
commit95df3522a15631abc51a4295cae0ea401a8d4e1e (patch)
treee5eb0f368c947683f01458e912f21756fb0d99cb /src/electron/ipc-api
parentdocs: add sad270 as a contributor for bug, userTesting [skip ci] (#1941) (diff)
downloadferdium-app-95df3522a15631abc51a4295cae0ea401a8d4e1e.tar.gz
ferdium-app-95df3522a15631abc51a4295cae0ea401a8d4e1e.tar.zst
ferdium-app-95df3522a15631abc51a4295cae0ea401a8d4e1e.zip
feat: add eslint-plugin-unicorn (#1936)
Diffstat (limited to 'src/electron/ipc-api')
-rw-r--r--src/electron/ipc-api/appIndicator.ts4
-rw-r--r--src/electron/ipc-api/autoUpdate.ts4
-rw-r--r--src/electron/ipc-api/cld.ts4
-rw-r--r--src/electron/ipc-api/dnd.ts4
-rw-r--r--src/electron/ipc-api/download.ts10
5 files changed, 12 insertions, 14 deletions
diff --git a/src/electron/ipc-api/appIndicator.ts b/src/electron/ipc-api/appIndicator.ts
index 5b5f2bac7..a51ed8161 100644
--- a/src/electron/ipc-api/appIndicator.ts
+++ b/src/electron/ipc-api/appIndicator.ts
@@ -34,8 +34,7 @@ export default params => {
34 34
35 ipcMain.on('updateAppIndicator', (_event, args) => { 35 ipcMain.on('updateAppIndicator', (_event, args) => {
36 // Flash TaskBar for windows, bounce Dock on Mac 36 // Flash TaskBar for windows, bounce Dock on Mac
37 if (!(app as any).mainWindow.isFocused()) { 37 if (!(app as any).mainWindow.isFocused() && params.settings.app.get('notifyTaskBarOnMessage')) {
38 if (params.settings.app.get('notifyTaskBarOnMessage')) {
39 if (isWindows) { 38 if (isWindows) {
40 (app as any).mainWindow.flashFrame(true); 39 (app as any).mainWindow.flashFrame(true);
41 (app as any).mainWindow.once('focus', () => 40 (app as any).mainWindow.once('focus', () =>
@@ -45,7 +44,6 @@ export default params => {
45 app.dock.bounce('informational'); 44 app.dock.bounce('informational');
46 } 45 }
47 } 46 }
48 }
49 47
50 // Update badge 48 // Update badge
51 if (isMac && typeof args.indicator === 'string') { 49 if (isMac && typeof args.indicator === 'string') {
diff --git a/src/electron/ipc-api/autoUpdate.ts b/src/electron/ipc-api/autoUpdate.ts
index 70890539d..31c614ab7 100644
--- a/src/electron/ipc-api/autoUpdate.ts
+++ b/src/electron/ipc-api/autoUpdate.ts
@@ -44,8 +44,8 @@ export default (params: { mainWindow: BrowserWindow; settings: any }) => {
44 app.quit(); 44 app.quit();
45 }, 20); 45 }, 20);
46 } 46 }
47 } catch (e) { 47 } catch (error) {
48 console.error(e); 48 console.error(error);
49 event.sender.send('autoUpdate', { error: true }); 49 event.sender.send('autoUpdate', { error: true });
50 } 50 }
51 } 51 }
diff --git a/src/electron/ipc-api/cld.ts b/src/electron/ipc-api/cld.ts
index b907f3730..4221f9b22 100644
--- a/src/electron/ipc-api/cld.ts
+++ b/src/electron/ipc-api/cld.ts
@@ -16,8 +16,8 @@ export default async () => {
16 16
17 return result.languages[0].code; 17 return result.languages[0].code;
18 } 18 }
19 } catch (e) { 19 } catch (error) {
20 console.error(e); 20 console.error(error);
21 } 21 }
22 }); 22 });
23}; 23};
diff --git a/src/electron/ipc-api/dnd.ts b/src/electron/ipc-api/dnd.ts
index 6fb8999a3..afaef9a66 100644
--- a/src/electron/ipc-api/dnd.ts
+++ b/src/electron/ipc-api/dnd.ts
@@ -15,8 +15,8 @@ export default async () => {
15 const isDND = getDoNotDisturb(); 15 const isDND = getDoNotDisturb();
16 debug('Fetching DND state, set to', isDND); 16 debug('Fetching DND state, set to', isDND);
17 return isDND; 17 return isDND;
18 } catch (e) { 18 } catch (error) {
19 console.error(e); 19 console.error(error);
20 return false; 20 return false;
21 } 21 }
22 }); 22 });
diff --git a/src/electron/ipc-api/download.ts b/src/electron/ipc-api/download.ts
index 822658f26..af15b157e 100644
--- a/src/electron/ipc-api/download.ts
+++ b/src/electron/ipc-api/download.ts
@@ -7,7 +7,7 @@ import { PathLike } from 'fs';
7const debug = require('debug')('Ferdi:ipcApi:download'); 7const debug = require('debug')('Ferdi:ipcApi:download');
8 8
9function decodeBase64Image(dataString: string) { 9function decodeBase64Image(dataString: string) {
10 const matches = dataString.match(/^data:([A-Za-z-+/]+);base64,(.+)$/); 10 const matches = dataString.match(/^data:([+/A-Za-z-]+);base64,(.+)$/);
11 11
12 if (matches?.length !== 3) { 12 if (matches?.length !== 3) {
13 return new Error('Invalid input string'); 13 return new Error('Invalid input string');
@@ -47,12 +47,12 @@ export default (params: { mainWindow: BrowserWindow }) => {
47 ); 47 );
48 48
49 debug('File blob saved to', saveDialog.filePath); 49 debug('File blob saved to', saveDialog.filePath);
50 } catch (err) { 50 } catch (error) {
51 console.log(err); 51 console.log(error);
52 } 52 }
53 } 53 }
54 } catch (e) { 54 } catch (error) {
55 console.error(e); 55 console.error(error);
56 } 56 }
57 }, 57 },
58 ); 58 );