diff --git a/src/main/account.js b/src/main/account.js index b7b8179c..c9358e84 100644 --- a/src/main/account.js +++ b/src/main/account.js @@ -36,6 +36,21 @@ export default class Account { ) }) } + + getAccount (id) { + return new Promise((resolve, reject) => { + this.db.findOne( + { + _id: id + }, + (err, doc) => { + if (err) return reject(err) + if (empty(doc)) return reject(new EmptyRecordError('empty')) + resolve(doc) + } + ) + }) + } } class EmptyRecordError { diff --git a/src/main/index.js b/src/main/index.js index 69ea92ad..b68a02b5 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -125,6 +125,17 @@ ipcMain.on('get-instance', (event, id) => { }) }) +ipcMain.on('get-local-account', (event, id) => { + const account = new Account(db) + account.getAccount(id) + .catch((err) => { + event.sender.send('error-get-local-account', err) + }) + .then((token) => { + event.sender.send('response-get-local-account', token) + }) +}) + /** * Auto Updater * diff --git a/src/renderer/components/TimelineSpace.vue b/src/renderer/components/TimelineSpace.vue index aef7beb1..69dbe096 100644 --- a/src/renderer/components/TimelineSpace.vue +++ b/src/renderer/components/TimelineSpace.vue @@ -22,6 +22,6 @@ export default { diff --git a/src/renderer/components/TimelineSpace/SideMenu.vue b/src/renderer/components/TimelineSpace/SideMenu.vue index dc251261..c2d4a7d8 100644 --- a/src/renderer/components/TimelineSpace/SideMenu.vue +++ b/src/renderer/components/TimelineSpace/SideMenu.vue @@ -2,7 +2,8 @@