Skip to content
This repository has been archived by the owner on Apr 14, 2023. It is now read-only.

Commit

Permalink
Fix error message handling
Browse files Browse the repository at this point in the history
  • Loading branch information
waylaidwanderer committed Dec 29, 2019
1 parent 29d4a8f commit 8087684
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 9 additions & 2 deletions client/src/views/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
<button @click="download">Download</button>
</div>
</div>
<div style="text-align: center;">

<div style="text-align: center;" v-show="error">
<p style="color: darkred;">{{ error }}</p>
</div>
<div v-show="Object.values(stories).length > 0">
<h3>Downloaded Stories</h3>
Expand Down Expand Up @@ -58,6 +58,7 @@ export default {
storyUrl: '',
format: 'epub',
email: '',
error: '',
};
},
computed: {
Expand All @@ -69,6 +70,12 @@ export default {
complete({ url }) {
window.location.href = url;
},
err({ msg }) {
this.error = msg;
setTimeout(() => {
this.error = '';
}, 10 * 1000);
},
},
methods: {
download() {
Expand Down
2 changes: 1 addition & 1 deletion server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ server.on('connection', (socket) => {
};
const onError = (data) => {
data = JSON.parse(data);
socket.emit('error', data);
socket.emit('err', data);
};
const onComplete = (data) => {
data = JSON.parse(data);
Expand Down

0 comments on commit 8087684

Please sign in to comment.