Disconnect other tabs when migrating the drive

This commit is contained in:
yflory
2017-06-09 12:23:28 +02:00
parent 51e0d40572
commit f8c69573fd
3 changed files with 20 additions and 3 deletions

View File

@@ -275,7 +275,6 @@ define([
&& !drive['filesData']) {
Cryptpad.getLegacyPads(function (err, data) {
drive[Cryptpad.oldStorageKey] = data;
console.log(drive);
onReady(f, rt.proxy, Cryptpad, exp);
});
return;
@@ -291,6 +290,15 @@ define([
}
return;
}
})
.on('change', ['drive'], function () {
var path = arguments[2];
var value = arguments[1];
if (path[1] === "migrate" && value === 1) {
rt.network.disconnect();
rt.realtime.abort();
Cryptpad.alert("Disconnected while migration");
}
});
};