always set userHash in localStorage even with modern users

This commit is contained in:
ansuz committed 2018-07-10 13:11:22 +02:00
1 parent ce7ebf0326
commit 0a9ea95796
3 files changed
+28 -19

No files matched your search

+3 -10
View File
@@ -75,18 +75,11 @@ define([
typeof getUserHash() === "string";
};
// XXX update this to take into account blockHash values
LocalStore.login = function (hash, name, cb) {
if (hash !== false && !hash) { throw new Error('expected a user hash'); }
if (!hash) { throw new Error('expected a user hash'); }
if (!name) { throw new Error('expected a user name'); }
if (hash) {
hash = Hash.serializeHash(hash);
localStorage.setItem(Constants.userHashKey, hash);
}
hash = Hash.serializeHash(hash);
localStorage.setItem(Constants.userHashKey, hash);
localStorage.setItem(Constants.userNameKey, name);
if (cb) { cb(); }
};