From 4c227b2dfaa14184cd19303076f5c70b0af420ed Mon Sep 17 00:00:00 2001
From: AkiraFukushima
Date: Tue, 13 Mar 2018 22:25:31 +0900
Subject: [PATCH] refs #16 Error message when authorize
---
src/renderer/components/Authorize.vue | 6 ++++++
src/renderer/store/Authorize.js | 3 +--
src/renderer/store/TimelineSpace.js | 4 ++--
3 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/src/renderer/components/Authorize.vue b/src/renderer/components/Authorize.vue
index 70773123..2f89072b 100644
--- a/src/renderer/components/Authorize.vue
+++ b/src/renderer/components/Authorize.vue
@@ -27,6 +27,12 @@ export default {
.then((id) => {
this.$router.push({ path: `/${id}/home` })
})
+ .catch(() => {
+ this.$message({
+ message: 'Could not authorize the code',
+ type: 'error'
+ })
+ })
}
}
}
diff --git a/src/renderer/store/Authorize.js b/src/renderer/store/Authorize.js
index 128b8377..4745185a 100644
--- a/src/renderer/store/Authorize.js
+++ b/src/renderer/store/Authorize.js
@@ -9,11 +9,10 @@ const Authorize = {
return new Promise((resolve, reject) => {
ipcRenderer.send('get-access-token', code)
ipcRenderer.once('response-get-access-token', (event, id) => {
- console.log(id)
resolve(id)
})
ipcRenderer.once('error-get-access-token', (event, err) => {
- console.log(err)
+ reject(err)
})
})
}
diff --git a/src/renderer/store/TimelineSpace.js b/src/renderer/store/TimelineSpace.js
index e3f115ff..e0baab10 100644
--- a/src/renderer/store/TimelineSpace.js
+++ b/src/renderer/store/TimelineSpace.js
@@ -46,8 +46,6 @@ const TimelineSpace = {
return new Promise((resolve, reject) => {
ipcRenderer.send('get-local-account', id)
ipcRenderer.once('error-get-local-account', (event, err) => {
- // TODO: handle error
- console.log(err)
reject(err)
})
ipcRenderer.once('response-get-local-account', (event, account) => {
@@ -73,6 +71,7 @@ const TimelineSpace = {
startUserStreaming ({ commit }, account) {
ipcRenderer.send('start-user-streaming', account)
ipcRenderer.once('error-start-userstreaming', (event, err) => {
+ // handle error
console.log(err)
})
ipcRenderer.on('update-start-user-streaming', (event, update) => {
@@ -94,6 +93,7 @@ const TimelineSpace = {
commit('changeNewTootModal', true)
})
ipcRenderer.on('CmdOrCtrl+R', () => {
+ // TODO: reply window
console.log('reply')
})
},