commit 0b3ea2b71dc4b315c1e7e78f2f1dbc9cb3e9b8d0
parent 7a4e17905926bb801fd678871e89bbaa18102bdb
Author: Jack Mordaunt <jackmordaunt@gmail.com>
Date: Thu, 8 Nov 2018 20:22:30 +1300
[!] The websocket isn't automatically parsed into json
so we do it.
Diffstat:
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/cmd/desktop/ui/src/App.vue b/cmd/desktop/ui/src/App.vue
@@ -114,16 +114,17 @@ export default {
let { file, info } = resp.data
let updates = new WebSocket(`ws://localhost:8081${info}`)
updates.onmessage = (msg) => {
- if (msg.error !== undefined) {
- this.errors.push(msg.error)
+ this.loading = false
+ updates.close()
+ let data = JSON.parse(msg.data)
+ console.log(data)
+ if (data.error !== undefined) {
+ this.errors.push(data.error)
return
}
console.log("ready to download!")
this.link = `http://localhost:8081${file}`
- updates.close()
- this.loading = false
}
-
})
.catch(err => {
console.log("catching error")