Add safety measures to avoid removing your drive by accident

This commit is contained in:
yflory
2019-08-12 15:30:59 +02:00
parent d823deff92
commit 5c6b3155ac
3 changed files with 25 additions and 12 deletions

View File

@@ -254,8 +254,12 @@ define([
common.clearOwnedChannel = function (channel, cb) {
postMessage("CLEAR_OWNED_CHANNEL", channel, cb);
};
common.removeOwnedChannel = function (channel, cb) {
postMessage("REMOVE_OWNED_CHANNEL", channel, cb);
// "force" allows you to delete your drive ID
common.removeOwnedChannel = function (channel, cb, force) {
postMessage("REMOVE_OWNED_CHANNEL", {
channel: channel,
force: force
}, cb);
};
common.getDeletedPads = function (data, cb) {
@@ -769,7 +773,7 @@ define([
waitFor.abort();
return void cb(obj);
}
}));
}), true);
common.unpinPads([oldChannel], waitFor());
common.pinPads([newSecret.channel], waitFor());
}).nThen(function (waitFor) {
@@ -950,7 +954,7 @@ define([
common.logoutFromAll(waitFor(function () {
postMessage("DISCONNECT");
}));
}));
}), true);
}
}).nThen(function (waitFor) {
if (!oldIsOwned) {