1
0
Fork 0
mirror of https://github.com/anyproto/anytype-ts.git synced 2025-06-08 05:57:02 +09:00

Merge branch 'master' into feature/722

This commit is contained in:
Razor 2020-11-23 19:35:40 +03:00 committed by GitHub
commit dcba2d2cb6
20 changed files with 520 additions and 252 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 = 980;
const MIN_HEIGHT = 640;
const KEYTAR_SERVICE = 'Anytype';
let isUpdating = false;
let userPath = app.getPath('userData');
@ -258,6 +260,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);
});