1
0
Fork 0
mirror of https://github.com/anyproto/anytype-ts.git synced 2025-06-08 05:57:02 +09:00
This commit is contained in:
Andrew Simachev 2020-11-26 10:26:59 +03:00
commit 8ea8d4ac21
17 changed files with 640 additions and 102 deletions

View file

@ -15,10 +15,12 @@ const Util = require('./electron/util.js');
const windowStateKeeper = require('electron-window-state');
const port = process.env.SERVER_PORT;
const openAboutWindow = require('about-window').default;
const keytar = require('keytar');
const TIMEOUT_UPDATE = 600 * 1000;
const MIN_WIDTH = 960;
const MIN_HEIGHT = 640;
const KEYTAR_SERVICE = 'Anytype';
let isUpdating = false;
let userPath = app.getPath('userData');
@ -259,6 +261,22 @@ function createWindow () {
send('config', config);
});
ipcMain.on('keytarSet', (e, key, value) => {
if (key && value) {
keytar.setPassword(KEYTAR_SERVICE, key, value);
};
});
ipcMain.on('keytarGet', (e, key) => {
keytar.getPassword(KEYTAR_SERVICE, key).then((value) => {
send('keytarGet', key, value);
});
});
ipcMain.on('keytarDelete', (e, key) => {
keytar.deletePassword(KEYTAR_SERVICE, key);
});
ipcMain.on('exit', (e, relaunch) => {
exit(relaunch);
});