WIP big commit
This commit is contained in:
@@ -80,10 +80,13 @@ define([
|
||||
|
||||
// XXX update this to take into account blockHash values
|
||||
LocalStore.login = function (hash, name, cb) {
|
||||
if (!hash) { throw new Error('expected a user hash'); }
|
||||
if (hash !== false && !hash) { throw new Error('expected a user hash'); }
|
||||
if (!name) { throw new Error('expected a user name'); }
|
||||
hash = Hash.serializeHash(hash);
|
||||
localStorage.setItem(Constants.userHashKey, hash);
|
||||
|
||||
if (hash) {
|
||||
hash = Hash.serializeHash(hash);
|
||||
localStorage.setItem(Constants.userHashKey, hash);
|
||||
}
|
||||
localStorage.setItem(Constants.userNameKey, name);
|
||||
if (cb) { cb(); }
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user