summaryrefslogtreecommitdiff
path: root/static/js/src/userlist.js
diff options
context:
space:
mode:
authorJulie Lala <jules@okfoc.us>2014-06-24 18:59:32 -0400
committerJulie Lala <jules@okfoc.us>2014-06-24 18:59:32 -0400
commit3d01a4b5e460c021554f0519722e558a5f12f1fd (patch)
tree5d7d30e4eb20c5d2d3d410d7b5899f07a9daa324 /static/js/src/userlist.js
parent050c61a79f2a58772a3d749c0a29d6e8fd2c34ef (diff)
forgot localstorage was a flat hash
Diffstat (limited to 'static/js/src/userlist.js')
-rw-r--r--static/js/src/userlist.js10
1 files changed, 4 insertions, 6 deletions
diff --git a/static/js/src/userlist.js b/static/js/src/userlist.js
index 9851ad8..7ac6e2f 100644
--- a/static/js/src/userlist.js
+++ b/static/js/src/userlist.js
@@ -1,13 +1,12 @@
-var MUTES = localStorage['mutes'] || {};
+var MUTES = localStorage["mutes"] ? JSON.parse(localStorage["mutes"]) : {}
$(".mute").live("click", function(){
$(this).removeClass("mute");
$(this).addClass("unmute");
$(this).html("o");
var nick = $(this).parent().children("a").html().replace(/<img[^>]+>/,"");
$(".nick_" + nick).hide();
- MUTES[nick] = true;
- localStorage['mutes'] = localStorage['mutes'] || {}
- localStorage['mutes'][nick] = true
+ MUTES[nick] = true
+ localStorage['mutes'] = JSON.stringify(MUTES)
});
$(".unmute").live("click", function(){
$(this).removeClass("unmute");
@@ -16,8 +15,7 @@ $(".unmute").live("click", function(){
var nick = $(this).parent().children("a").html().replace(/<img[^>]+>/,"");
$(".nick_" + nick).show();
delete MUTES[nick];
- localStorage['mutes'] = localStorage['mutes'] || {}
- delete localStorage['mutes'][nick]
+ localStorage['mutes'] = JSON.stringify(MUTES)
});
function buildUserDiv(user) {