Fixed reconnect feature
This commit is contained in:
parent
c5c05aea04
commit
ed1d375c63
@ -7,6 +7,12 @@ component Editor(url string, score int, scoreTitle string, scoreTypes map[string
|
|||||||
.feature-card-icon.editor-score= score
|
.feature-card-icon.editor-score= score
|
||||||
p.feature-card-text Your contribution score.
|
p.feature-card-text Your contribution score.
|
||||||
|
|
||||||
|
.feature-cards
|
||||||
|
a.feature-card.mountable(href="/editor/anime")
|
||||||
|
.feature-card-icon
|
||||||
|
RawIcon("tv")
|
||||||
|
p.feature-card-text Anime
|
||||||
|
|
||||||
//- .footer
|
//- .footer
|
||||||
//- for objectType, score := range scoreTypes
|
//- for objectType, score := range scoreTypes
|
||||||
//- .mountable
|
//- .mountable
|
||||||
|
@ -74,11 +74,22 @@ export default class Application {
|
|||||||
|
|
||||||
let retry = () => {
|
let retry = () => {
|
||||||
return this.get("/_" + url).catch(async error => {
|
return this.get("/_" + url).catch(async error => {
|
||||||
|
// Are we still on that page?
|
||||||
|
if(this.currentPath !== url) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// Display connection error
|
// Display connection error
|
||||||
this.onError(error)
|
this.onError(error)
|
||||||
|
|
||||||
// Retry after 3 seconds
|
// Retry after 3 seconds
|
||||||
await delay(3000)
|
await delay(3000)
|
||||||
|
|
||||||
|
// Are we still on that page?
|
||||||
|
if(this.currentPath !== url) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
return retry()
|
return retry()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user