Skip to content

Commit

Permalink
stop interval when error happens
Browse files Browse the repository at this point in the history
  • Loading branch information
Gkiokan committed Jan 30, 2022
1 parent a0a57f1 commit c040c0a
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 8 deletions.
1 change: 1 addition & 0 deletions src/renderer/pages/Changelog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
Added css to fix the header, so it stays there when you scroll. <br>
Added prefix full path URL to the serving file (CyB1K request), so every file is unique. <br>
Added Suport Information on Settings View if anyone want to help and support me. <br>
Stop Interval if there is an error. <br>
</p>
</el-timeline-item>
<el-timeline-item timestamp="2.5.1" placement="top">
Expand Down
41 changes: 33 additions & 8 deletions src/renderer/pages/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,10 @@ export default {
this.log(data.message, { exists, size, type })
this.$message({ message: data.message, type: data.type })
})
.catch( e => console.log(e) )
.catch( e => {
this.clearInterval(file)
console.log(e)
})
},
start(file){
Expand Down Expand Up @@ -247,7 +250,10 @@ export default {
}
})
.catch( e => console.log(e) )
.catch( e => {
this.clearInterval(file)
console.log(e)
})
},
stop(file){
Expand All @@ -261,7 +267,10 @@ export default {
this.setStatus(file, 'stop')
this.log(file.name + ' stop Task ID ' + file.task, data)
})
.catch( e => console.log(e) )
.catch( e => {
this.clearInterval(file)
console.log(e)
})
},
pause(file){
Expand All @@ -275,7 +284,10 @@ export default {
this.setStatus(file, 'pause')
this.log(file.name + ' pause', data)
})
.catch( e => console.log(e) )
.catch( e => {
this.clearInterval(file)
console.log(e)
})
},
resume(file){
Expand All @@ -293,7 +305,10 @@ export default {
this.log(file.name + ' resume Task ID ' + file.task, data)
}
})
.catch( e => console.log(e) )
.catch( e => {
this.clearInterval(file)
console.log(e)
})
},
remove(file){
Expand All @@ -306,7 +321,10 @@ export default {
console.log(data)
this.log(file.name + ' remove', data)
})
.catch( e => console.log(e) )
.catch( e => {
this.clearInterval(file)
console.log(e)
})
},
info(file){
Expand Down Expand Up @@ -370,10 +388,14 @@ export default {
else {
console.log("Task Info Fail", data)
this.log(file.name + ' Info fail', data)
this.clearInterval(file)
}
})
.catch( e => console.log(e) )
.catch( e => {
this.clearInterval(file)
console.log(e)
})
// this.log(file.name + ' info')
},
Expand All @@ -383,7 +405,10 @@ export default {
.then( ({ data }) => {
this.log(file.name + ' find', data)
})
.catch( e => console.log(e) )
.catch( e => {
this.clearInterval(file)
console.log(e)
})
},
startInterval(file){
Expand Down

0 comments on commit c040c0a

Please sign in to comment.