Display an error when an invalid hash in used

This commit is contained in:
yflory
2019-02-06 15:35:27 +01:00
parent 2815c96ce8
commit 6c1da07c60
3 changed files with 40 additions and 9 deletions

View File

@@ -557,6 +557,19 @@ define([
UIElements.displayStorePadPopup(funcs, data);
});
ctx.sframeChan.on('EV_LOADING_ERROR', function (err) {
var msg = err;
if (err === 'DELETED') {
msg = Messages.deletedError + '<br>' + Messages.errorRedirectToHome;
}
if (err === "INVALID_HASH") {
msg = Messages.invalidHashError; // XXX
}
UI.errorLoadingScreen(msg, false, function () {
funcs.gotoURL('/drive/');
});
});
ctx.metadataMgr.onReady(waitFor());
funcs.addShortcuts();
@@ -591,15 +604,6 @@ define([
window.CP_DEV_MODE = ctx.metadataMgr.getPrivateData().devMode;
} catch (e) {}
ctx.sframeChan.on('EV_LOADING_ERROR', function (err) {
if (err === 'DELETED') {
var msg = Messages.deletedError + '<br>' + Messages.errorRedirectToHome;
UI.errorLoadingScreen(msg, false, function () {
funcs.gotoURL('/drive/');
});
}
});
ctx.sframeChan.on('EV_LOGOUT', function () {
$(window).on('keyup', function (e) {
if (e.keyCode === 27) {