diff --git a/app/javascript/src/javascripts/post_search.js b/app/javascript/src/javascripts/post_search.js index 66eabcbbf..b5b3e6a17 100644 --- a/app/javascript/src/javascripts/post_search.js +++ b/app/javascript/src/javascripts/post_search.js @@ -30,16 +30,9 @@ PostSearch.initialize_input = function ($form) { PostSearch.initialize_wiki_preview = function ($preview) { let visible = LStorage.Posts.WikiExcerpt; - switch (visible) { - case 1: { - $preview.addClass("open"); - break; - } - case 2: { - $preview.addClass("hidden"); - break; - } - } + if (visible == 2) return; // hidden + if (visible == 1) $preview.addClass("open"); + $preview.removeClass("hidden"); window.setTimeout(() => { // Disable the rollout on first load $preview.removeClass("loading"); diff --git a/app/views/posts/partials/index/_posts.html.erb b/app/views/posts/partials/index/_posts.html.erb index 490752d6f..0bdc55dc0 100644 --- a/app/views/posts/partials/index/_posts.html.erb +++ b/app/views/posts/partials/index/_posts.html.erb @@ -1,6 +1,6 @@