From f6c6f6e7a1ea7fb2946aaea0b3ee6246a30fe4c7 Mon Sep 17 00:00:00 2001 From: Sam Date: Tue, 11 Aug 2015 12:40:51 +1000 Subject: [PATCH] FIX: if localStorage is disabled, still boot --- app/assets/javascripts/discourse/lib/key_value_store.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/lib/key_value_store.js b/app/assets/javascripts/discourse/lib/key_value_store.js index 17d17c76a3e..ecb1651eb92 100644 --- a/app/assets/javascripts/discourse/lib/key_value_store.js +++ b/app/assets/javascripts/discourse/lib/key_value_store.js @@ -10,9 +10,13 @@ var safeLocalStorage; try { - safeLocalStorage = localStorage; + safeLocalStorage = localStorage; + if (localStorage["disableLocalStorage"] === "true") { + safeLocalStorage = null; + } } catch(e){ // cookies disabled, we don't care + safeLocalStorage = null; } Discourse.KeyValueStore = {