mirror of
https://github.com/cryptpad/cryptpad.git
synced 2026-09-14 11:05:41 +05:00
Fix broken redirect on account password change
This commit is contained in:
parent
880fd3383f
commit
bc7e4b8918
@ -390,7 +390,7 @@ define([
|
||||
});
|
||||
};
|
||||
common.stopWorker = function () {
|
||||
postMessage('STOPWORKER', null, function () {});
|
||||
postMessage('STOPWORKER');
|
||||
};
|
||||
common.logoutFromAll = function (cb) {
|
||||
var token = Math.floor(Math.random()*Number.MAX_SAFE_INTEGER);
|
||||
@ -2073,7 +2073,7 @@ define([
|
||||
return;
|
||||
}
|
||||
common.logoutFromAll(waitFor(function () {
|
||||
postMessage("DISCONNECT");
|
||||
common.stopWorker();
|
||||
}));
|
||||
}));
|
||||
}).nThen(function (waitFor) {
|
||||
@ -2088,7 +2088,7 @@ define([
|
||||
console.error(obj.error);
|
||||
}
|
||||
common.logoutFromAll(waitFor(function () {
|
||||
postMessage("DISCONNECT");
|
||||
common.stopWorker();
|
||||
}));
|
||||
}));
|
||||
}).nThen(function () {
|
||||
@ -2790,7 +2790,7 @@ define([
|
||||
});
|
||||
LocalStore.onLogout(function () {
|
||||
console.log('onLogout: disconnect');
|
||||
postMessage("DISCONNECT");
|
||||
common.stopWorker();
|
||||
});
|
||||
}).nThen(function (waitFor) {
|
||||
if (common.migrateAnonDrive || sessionStorage.migrateAnonDrive) {
|
||||
|
||||
@ -31,6 +31,7 @@ define([
|
||||
});
|
||||
});
|
||||
chan.on('STOPWORKER', function (data, cb) {
|
||||
Rpc.queries['DISCONNECT'](clientId, data, cb);
|
||||
cb();
|
||||
});
|
||||
chan.on('CONNECT', function (cfg, cb) {
|
||||
|
||||
@ -72,7 +72,7 @@ var init = function (client, cb) {
|
||||
}
|
||||
});
|
||||
});
|
||||
chan.on('STOPWORKER', function (data, cb) {
|
||||
chan.on('STOPWORKER', function () {
|
||||
self.close();
|
||||
});
|
||||
chan.on('CONNECT', function (cfg, cb) {
|
||||
|
||||
@ -28,6 +28,7 @@ require(['/api/config?cb=' + (+new Date()).toString(16)], function (ApiConfig) {
|
||||
if (q === 'CONNECT') { return; }
|
||||
if (q === 'JOIN_PAD') { return; }
|
||||
if (q === 'SEND_PAD_MSG') { return; }
|
||||
if (q === 'STOPWORKER') { return; }
|
||||
chan.on(q, function (data, cb) {
|
||||
try {
|
||||
Rpc.queries[q](clientId, data, cb);
|
||||
@ -38,6 +39,9 @@ require(['/api/config?cb=' + (+new Date()).toString(16)], function (ApiConfig) {
|
||||
}
|
||||
});
|
||||
});
|
||||
chan.on('STOPWORKER', function () {
|
||||
self.close();
|
||||
});
|
||||
chan.on('CONNECT', function (cfg, cb) {
|
||||
// load Store here, with cfg, and pass a "query" (chan.query)
|
||||
// cId is a clientId used in ServiceWorker or SharedWorker
|
||||
|
||||
@ -1343,7 +1343,6 @@ define([
|
||||
});
|
||||
|
||||
sframeChan.on('Q_LOGOUT', function (data, cb) {
|
||||
Cryptpad.stopWorker();
|
||||
Utils.LocalStore.logout(cb);
|
||||
});
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user