Delay reloading the page if an ajax error occurs, show notification

This commit is contained in:
Robin McCorkell 2016-04-20 16:31:04 +01:00 committed by Vincent Petry
parent 7f3f06cdd9
commit 40f066ab6d
No known key found for this signature in database
GPG Key ID: AF8F9EFC56562186
1 changed files with 2 additions and 1 deletions

View File

@ -752,7 +752,8 @@ var OC={
// sometimes "beforeunload" happens later, so need to defer the reload a bit // sometimes "beforeunload" happens later, so need to defer the reload a bit
setTimeout(function() { setTimeout(function() {
if (!self._userIsNavigatingAway && !self._reloadCalled) { if (!self._userIsNavigatingAway && !self._reloadCalled) {
OC.reload(); OC.Notification.show(t('core', 'Problem loading page, reloading in 5 seconds'));
setTimeout(OC.reload, 5000);
// only call reload once // only call reload once
self._reloadCalled = true; self._reloadCalled = true;
} }