From ae56f389c56d0f4bceb28f2fa595adddf53b6e6e Mon Sep 17 00:00:00 2001 From: leejinho Date: Tue, 18 Feb 2020 16:05:07 +0900 Subject: [PATCH] clear configuration logic add. but not appearence --- .../ucap-webmessenger-electron/src/index.ts | 7 +++++ .../src/lib/storage.ts | 9 +++++++ .../messenger-settings.dialog.component.html | 7 +++++ .../messenger-settings.dialog.component.ts | 27 +++++++++++++++++-- .../lib/services/browser-native.service.ts | 2 ++ .../lib/services/electron-native.service.ts | 4 +++ .../src/lib/types/channel.type.ts | 1 + .../src/lib/services/native.service.ts | 1 + 8 files changed, 56 insertions(+), 2 deletions(-) diff --git a/electron-projects/ucap-webmessenger-electron/src/index.ts b/electron-projects/ucap-webmessenger-electron/src/index.ts index 03ef4eab..40cea98f 100644 --- a/electron-projects/ucap-webmessenger-electron/src/index.ts +++ b/electron-projects/ucap-webmessenger-electron/src/index.ts @@ -420,6 +420,13 @@ ipcMain.on( } ); +ipcMain.on( + MessengerChannel.ClearAppStorage, + (event: IpcMainEvent, ...args: any[]) => { + appStorage.reset(); + } +); + ipcMain.on( MessengerChannel.ChangeAutoLaunch, (event: IpcMainEvent, ...args: any[]) => { diff --git a/electron-projects/ucap-webmessenger-electron/src/lib/storage.ts b/electron-projects/ucap-webmessenger-electron/src/lib/storage.ts index a4fe91cf..0ece865b 100644 --- a/electron-projects/ucap-webmessenger-electron/src/lib/storage.ts +++ b/electron-projects/ucap-webmessenger-electron/src/lib/storage.ts @@ -53,6 +53,15 @@ export class Storage { get constDefaultDownloadFolder(): string { return DOWNLOAD_FOLDER_PATH; } + + reset(): void { + this.store.set({ + options: { + startupHideWindow: false, + downloadPath: path.join(app.getPath('documents'), DOWNLOAD_FOLDER_PATH) + } + }); + } } export const appStorage: Storage = new Storage(); diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/settings/messenger-settings.dialog.component.html b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/settings/messenger-settings.dialog.component.html index 8dfcbc31..4180cb5a 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/settings/messenger-settings.dialog.component.html +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/settings/messenger-settings.dialog.component.html @@ -124,6 +124,13 @@ +