From 4fd949ca8d2b153af37148643a128dca9ca507ed Mon Sep 17 00:00:00 2001 From: evazion Date: Tue, 2 Oct 2018 13:28:41 -0500 Subject: [PATCH] news updates: fix news updates not staying hidden. ref: https://danbooru.donmai.us/forum_posts/151011 Bug: `Cookie.get("news-ticker") === key` always returned false because the cookie was a string but the key was an integer. Regressed in f72b32b27b after switching from `==` to `===`. --- app/javascript/src/javascripts/news_updates.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/javascript/src/javascripts/news_updates.js b/app/javascript/src/javascripts/news_updates.js index 60f90f557..d3f1490ce 100644 --- a/app/javascript/src/javascripts/news_updates.js +++ b/app/javascript/src/javascripts/news_updates.js @@ -3,7 +3,7 @@ import Cookie from './cookie' let NewsUpdate = {}; NewsUpdate.initialize = function() { - var key = $("#news-updates").data("id"); + var key = $("#news-updates").data("id").toString(); if (Cookie.get("news-ticker") === key) { $("#news-updates").hide();