Notify users when index refresh failed due to a server/network error.
This commit is contained in:
parent
4fafd7fd3f
commit
60f3f88178
@ -227,6 +227,16 @@ Index =
|
||||
notice.close()
|
||||
return
|
||||
|
||||
if req.status not in [200, 304]
|
||||
err = "Index refresh failed. Error #{req.statusText} (#{req.status})"
|
||||
if notice
|
||||
notice.setType 'warning'
|
||||
notice.el.lastElementChild.textContent = err
|
||||
setTimeout notice.close, $.SECOND
|
||||
else
|
||||
new Notice 'warning', err, 1
|
||||
return
|
||||
|
||||
try
|
||||
if req.status is 200
|
||||
Index.parse JSON.parse(req.response), pageNum
|
||||
@ -238,9 +248,9 @@ Index =
|
||||
if notice
|
||||
notice.setType 'error'
|
||||
notice.el.lastElementChild.textContent = 'Index refresh failed.'
|
||||
setTimeout notice.close, 2 * $.SECOND
|
||||
setTimeout notice.close, $.SECOND
|
||||
else
|
||||
new Notice 'error', 'Index refresh failed.', 2
|
||||
new Notice 'error', 'Index refresh failed.', 1
|
||||
return
|
||||
|
||||
if notice
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user