handle more possible cases
This commit is contained in:
parent
1682d23c1c
commit
86cda4357b
@ -124,9 +124,24 @@ define([
|
|||||||
|
|
||||||
/* if the user is registering, we expect that the userDoc will be empty
|
/* if the user is registering, we expect that the userDoc will be empty
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
var proxykeys = Object.keys(proxy);
|
||||||
|
|
||||||
if (opt.register) {
|
if (opt.register) {
|
||||||
if (Object.keys(proxy).length) {
|
if (proxyKeys.length) {
|
||||||
|
// user is trying to register, but the userDoc is not empty
|
||||||
|
// tell them they are already registered.
|
||||||
|
|
||||||
|
|
||||||
alreadyExists();
|
alreadyExists();
|
||||||
|
} else {
|
||||||
|
// trying to register, and the object is empty, as expected
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (proxyKeys.length) {
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -196,6 +211,7 @@ define([
|
|||||||
$register[0].checked = false;
|
$register[0].checked = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Cryptpad.ready(function () {
|
||||||
if (Cryptpad.getUserHash()) {
|
if (Cryptpad.getUserHash()) {
|
||||||
//Cryptpad.alert("You are already logged in!");
|
//Cryptpad.alert("You are already logged in!");
|
||||||
$logoutBox.slideDown();
|
$logoutBox.slideDown();
|
||||||
@ -233,3 +249,4 @@ define([
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user