lbry-desktop/src/ui/util/saved-passwords.js

46 lines
983 B
JavaScript
Raw Normal View History

2019-08-28 04:35:07 +02:00
import { ipcRenderer } from 'electron';
2019-08-20 14:29:59 +02:00
2019-08-28 04:35:07 +02:00
export const setSavedPassword = value => {
return new Promise(
resolve => {
ipcRenderer.once('set-password-response', (event, success) => {
resolve(success);
});
ipcRenderer.send('set-password', value);
},
reject => {
reject(false);
}
);
2019-08-20 14:29:59 +02:00
};
2019-08-28 04:35:07 +02:00
export const getSavedPassword = () => {
return new Promise(
resolve => {
ipcRenderer.once('get-password-response', (event, password) => {
resolve(password);
});
ipcRenderer.send('get-password');
},
reject => reject(false)
);
2019-08-26 22:18:30 +02:00
};
2019-08-20 14:29:59 +02:00
2019-08-28 04:35:07 +02:00
export const deleteSavedPassword = () => {
return new Promise(
resolve => {
ipcRenderer.once('delete-password-response', (event, success) => {
resolve(success);
});
ipcRenderer.send('delete-password');
},
reject => {
reject(false);
}
);
};
export const testKeychain = () => {
// we should make sure it works on startup
2019-08-27 21:11:56 +02:00
};