Tell the user when a pad is expired and not deleted
parent
dc2a22fb8d
commit
9c6c229727
|
@ -286,6 +286,7 @@ define([
|
|||
};
|
||||
|
||||
var newHref;
|
||||
var expire;
|
||||
nThen(function (w) {
|
||||
if (parsed.hashData.key || !parsed.hashData.channel) { return; }
|
||||
var edit = parsed.hashData.mode === 'edit';
|
||||
|
@ -308,6 +309,7 @@ define([
|
|||
if (edit && !res.href) {
|
||||
newHref = res.roHref;
|
||||
}
|
||||
expire = res.expire;
|
||||
// We have good data, keep the hash in memory
|
||||
newHref = edit ? res.href : (res.roHref || res.href);
|
||||
}));
|
||||
|
@ -344,6 +346,11 @@ define([
|
|||
}
|
||||
// Not a file, so we can use `isNewChannel`
|
||||
Cryptpad.isNewChannel(currentPad.href, password, w(function(e, isNew) {
|
||||
if (isNew && expire && expire < (+new Date())) {
|
||||
sframeChan.event("EV_EXPIRED_ERROR");
|
||||
waitFor.abort();
|
||||
return;
|
||||
}
|
||||
if (!isNew) { return void todo(); }
|
||||
if (parsed.hashData.mode === 'view' && (password || !parsed.hashData.password)) {
|
||||
// Error, wrong password stored, the view seed has changed with the password
|
||||
|
|
|
@ -675,6 +675,12 @@ define([
|
|||
UI.errorLoadingScreen(Messages.password_error_seed);
|
||||
});
|
||||
|
||||
ctx.sframeChan.on("EV_EXPIRED_ERROR", function () {
|
||||
funcs.onServerError({
|
||||
type: 'EEXPIRED'
|
||||
});
|
||||
});
|
||||
|
||||
ctx.sframeChan.on('EV_LOADING_INFO', function (data) {
|
||||
UI.updateLoadingProgress(data, 'drive');
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue