This commit is contained in:
Abhinav 2022-07-11 02:42:31 +05:30
parent 171412575e
commit 7ea105038a
3 changed files with 8 additions and 0 deletions

View file

@ -10,6 +10,8 @@ import {
} from './utils/upload';
import { logError } from './utils/logging';
import { ElectronFile } from './types';
import { getAppVersion } from './utils/common';
import { getEncryptionKey, setEncryptionKey } from './utils/safeStorage';
const { ipcRenderer } = electron;
@ -172,4 +174,7 @@ windowObject['ElectronAPIs'] = {
showUploadZipDialog,
getElectronFilesFromGoogleZip,
setToUploadCollection,
getAppVersion,
getEncryptionKey,
setEncryptionKey,
};

View file

@ -1,2 +1,4 @@
import { app } from 'electron';
export const isDev = !app.isPackaged;
export const getAppVersion = () => app.getVersion();

View file

@ -2,6 +2,7 @@ import { safeStorage } from 'electron';
import { safeStorageStore } from '../services/store';
export function setEncryptionKey(encryptionKey: string) {
console.log(encryptionKey);
const buffer = safeStorage.encryptString(encryptionKey);
safeStorageStore.set('encryptionKey', buffer.toString('base64'));
}