X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=frontend%2Fjs%2Fapp.js;h=e446db3dd374530f2309f1b8fe6c772e4ff2f70e;hb=701c2be63f33a868f0369fe95d823ed0b11ec683;hp=0a6ada16c788cae357568b8625cea425993f99ff;hpb=996e13b351ddcc106e4700adc6257d0815e2cd23;p=perso%2FImmae%2FProjets%2FNodejs%2FSurfer.git diff --git a/frontend/js/app.js b/frontend/js/app.js index 0a6ada1..e446db3 100644 --- a/frontend/js/app.js +++ b/frontend/js/app.js @@ -171,7 +171,8 @@ function uploadFiles(files) { if (!(event.target instanceof XMLHttpRequestUpload)) return; app.uploadStatus.done = finishedUploadSize + event.loaded; - app.uploadStatus.percentDone = Math.round(app.uploadStatus.done / app.uploadStatus.size * 100); + var tmp = Math.round(app.uploadStatus.done / app.uploadStatus.size * 100); + app.uploadStatus.percentDone = tmp > 100 ? 100 : tmp; }).end(function (error, result) { if (result && result.statusCode === 401) return logout(); if (result && result.statusCode !== 201) return callback('Error uploading file: ', result.statusCode); @@ -288,7 +289,7 @@ var app = new Vue({ getProfile(result.body.accessToken, function (error) { if (error) return console.error(error); - loadDirectory(window.location.hash.slice(1)); + loadDirectory(decode(window.location.hash.slice(1))); }); }); }, @@ -428,11 +429,11 @@ var app = new Vue({ getProfile(localStorage.accessToken, function (error) { if (error) return console.error(error); - loadDirectory(window.location.hash.slice(1)); + loadDirectory(decode(window.location.hash.slice(1))); }); $(window).on('hashchange', function () { - loadDirectory(window.location.hash.slice(1)); + loadDirectory(decode(window.location.hash.slice(1))); }); })();