aboutsummaryrefslogtreecommitdiffstats
path: root/src/electron/ipc-api
diff options
context:
space:
mode:
authorLibravatar Vijay Aravamudhan <vraravam@users.noreply.github.com>2022-04-22 15:04:21 -0500
committerLibravatar GitHub <noreply@github.com>2022-04-22 20:04:21 +0000
commit759d93dc198a3cc8c5265245c0144efa5435682b (patch)
tree53e963a085d3d12af5a2efa2f1ab6f3e5574edc7 /src/electron/ipc-api
parentAdded build scripts for linux, macos and windows to help new contributors get... (diff)
downloadferdium-app-759d93dc198a3cc8c5265245c0144efa5435682b.tar.gz
ferdium-app-759d93dc198a3cc8c5265245c0144efa5435682b.tar.zst
ferdium-app-759d93dc198a3cc8c5265245c0144efa5435682b.zip
Turn off usage of 'debug' npm package using with electron-16 (fixes #17)
Diffstat (limited to 'src/electron/ipc-api')
-rw-r--r--src/electron/ipc-api/download.ts7
-rw-r--r--src/electron/ipc-api/sessionStorage.ts9
2 files changed, 9 insertions, 7 deletions
diff --git a/src/electron/ipc-api/download.ts b/src/electron/ipc-api/download.ts
index cb2aa7383..3631e8fee 100644
--- a/src/electron/ipc-api/download.ts
+++ b/src/electron/ipc-api/download.ts
@@ -4,7 +4,8 @@ import mime from 'mime-types';
4import { writeFileSync } from 'fs-extra'; 4import { writeFileSync } from 'fs-extra';
5import { PathLike } from 'fs'; 5import { PathLike } from 'fs';
6 6
7const debug = require('debug')('Ferdium:ipcApi:download'); 7// TODO: Go back to 'debug' from 'console.log' when https://github.com/electron/electron/issues/31689 is fixed
8// const debug = require('debug')('Ferdium:ipcApi:download');
8 9
9function decodeBase64Image(dataString: string) { 10function decodeBase64Image(dataString: string) {
10 const matches = dataString.match(/^data:([+/A-Za-z-]+);base64,(.+)$/); 11 const matches = dataString.match(/^data:([+/A-Za-z-]+);base64,(.+)$/);
@@ -27,7 +28,7 @@ export default (params: { mainWindow: BrowserWindow }) => {
27 const dl = await download(win!, url, { 28 const dl = await download(win!, url, {
28 saveAs: true, 29 saveAs: true,
29 }); 30 });
30 debug('File saved to', dl.savePath); 31 console.log('File saved to', dl.savePath);
31 } else { 32 } else {
32 const extension = mime.extension(fileOptions.mime); 33 const extension = mime.extension(fileOptions.mime);
33 const filename = `${fileOptions.name}.${extension}`; 34 const filename = `${fileOptions.name}.${extension}`;
@@ -46,7 +47,7 @@ export default (params: { mainWindow: BrowserWindow }) => {
46 'binary', 47 'binary',
47 ); 48 );
48 49
49 debug('File blob saved to', saveDialog.filePath); 50 console.log('File blob saved to', saveDialog.filePath);
50 } catch (error) { 51 } catch (error) {
51 console.error(error); 52 console.error(error);
52 } 53 }
diff --git a/src/electron/ipc-api/sessionStorage.ts b/src/electron/ipc-api/sessionStorage.ts
index 20f0ac9d2..96acacd12 100644
--- a/src/electron/ipc-api/sessionStorage.ts
+++ b/src/electron/ipc-api/sessionStorage.ts
@@ -2,7 +2,8 @@ import { ipcMain, Session, session } from 'electron';
2 2
3import { TODOS_PARTITION_ID } from '../../config'; 3import { TODOS_PARTITION_ID } from '../../config';
4 4
5const debug = require('debug')('Ferdium:ipcApi:sessionStorage'); 5// TODO: Go back to 'debug' from 'console.log' when https://github.com/electron/electron/issues/31689 is fixed
6// const debug = require('debug')('Ferdium:ipcApi:sessionStorage');
6 7
7function deduceSession(serviceId: string | undefined | null): Session { 8function deduceSession(serviceId: string | undefined | null): Session {
8 if (serviceId) { 9 if (serviceId) {
@@ -21,14 +22,14 @@ export default async () => {
21 const serviceSession = deduceSession(serviceId); 22 const serviceSession = deduceSession(serviceId);
22 serviceSession.flushStorageData(); 23 serviceSession.flushStorageData();
23 if (targetsToClear) { 24 if (targetsToClear) {
24 debug('Clearing targets:', targetsToClear); 25 console.log('Clearing targets:', targetsToClear);
25 serviceSession.clearStorageData(targetsToClear); 26 serviceSession.clearStorageData(targetsToClear);
26 } else { 27 } else {
27 debug('Clearing all targets'); 28 console.log('Clearing all targets');
28 serviceSession.clearStorageData(); 29 serviceSession.clearStorageData();
29 } 30 }
30 } catch (error) { 31 } catch (error) {
31 debug(error); 32 console.log(error);
32 } 33 }
33 }); 34 });
34 35