mirror of
https://github.com/discourse/discourse.git
synced 2024-12-02 13:39:36 -06:00
regression, missing local storage would cause script to break
This commit is contained in:
parent
78b879d666
commit
85d9b2d227
@ -64,7 +64,13 @@ var initializeUngroupedIcons = function(){
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!localStorage.emojiUsage) { localStorage.emojiUsage = "{}"; }
|
try {
|
||||||
|
if (localStorage && !localStorage.emojiUsage) { localStorage.emojiUsage = "{}"; }
|
||||||
|
} catch(e){
|
||||||
|
/* localStorage can be disabled, or cookies disabled, do not crash script here
|
||||||
|
* TODO introduce a global wrapper for dealing with local storage
|
||||||
|
* */
|
||||||
|
}
|
||||||
|
|
||||||
var trackEmojiUsage = function(title){
|
var trackEmojiUsage = function(title){
|
||||||
var recent = JSON.parse(localStorage.emojiUsage);
|
var recent = JSON.parse(localStorage.emojiUsage);
|
||||||
|
Loading…
Reference in New Issue
Block a user