summaryrefslogtreecommitdiffstats
path: root/apps/files/js
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2014-07-04 14:08:48 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2014-07-04 16:20:27 +0200
commit4fe1cdd2a7a1930d8ca0cb5bc23e5bfa22be6e55 (patch)
treebabd66d6a90c887c7bc6f97162b7b27156e608ec /apps/files/js
parent2327d41b11e11ca0553c829b5d7adeb0f000a474 (diff)
downloadnextcloud-server-4fe1cdd2a7a1930d8ca0cb5bc23e5bfa22be6e55.tar.gz
nextcloud-server-4fe1cdd2a7a1930d8ca0cb5bc23e5bfa22be6e55.zip
Add machine readable error messages to OC\JSON
Reload the files app in case of authentication errors, expired tokens or disabled app Reloading will triger the full server side handeling of those errors formatting fix missing semicolon + some jshint warnings
Diffstat (limited to 'apps/files/js')
-rw-r--r--apps/files/js/filelist.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index 400e3e28f00..80b30968eff 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -945,6 +945,13 @@
this.hideMask();
if (!result || result.status === 'error') {
+ // if the error is not related to folder we're trying to load, reload the page to handle logout etc
+ if (result.data.error === 'authentication_error' ||
+ result.data.error === 'token_expired' ||
+ result.data.error === 'application_not_enabled'
+ ) {
+ OC.redirect(OC.generateUrl('apps/files'));
+ }
OC.Notification.show(result.data.message);
return false;
}
@@ -968,7 +975,7 @@
}
this.setFiles(result.data.files);
- return true
+ return true;
},
updateStorageStatistics: function(force) {
@@ -1566,7 +1573,7 @@
numMatch=base.match(/\((\d+)\)/);
var num=2;
if (numMatch && numMatch.length>0) {
- num=parseInt(numMatch[numMatch.length-1])+1;
+ num=parseInt(numMatch[numMatch.length-1], 10)+1;
base=base.split('(');
base.pop();
base=$.trim(base.join('('));