diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index d56d34ba..0fe538f8 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -247,12 +247,6 @@ class ApplicationController < ActionController::Base return if params[:format] == "xml" || params[:format] == "json" - cookies["forum_post_last_read_at"] = if @current_user.is_anonymous? - Time.now - else - @current_user.last_forum_topic_read_at || Time.at(0) - end.to_json - if !@current_user.is_anonymous? cookies["user_id"] = @current_user.id.to_s diff --git a/app/javascript/src/classes/menu.coffee b/app/javascript/src/classes/menu.coffee index 3de5f73c..e7195f20 100644 --- a/app/javascript/src/classes/menu.coffee +++ b/app/javascript/src/classes/menu.coffee @@ -95,7 +95,7 @@ export default class Menu @forumMenuItems ?= JSON.parse(document.getElementById("forum-posts-latest").text) - last_read = JSON.parse(Cookies.get('forum_post_last_read_at')) + last_read = JSON.parse(document.getElementById('forum-post-last-read-at').text) forum_menu_items = @forumMenuItems forum_submenu = $('li.forum ul.submenu', @menu) forum_items_start = forum_submenu.find('.forum-items-start').show() diff --git a/app/models/anonymous_user.rb b/app/models/anonymous_user.rb index 514eecb4..dda70772 100644 --- a/app/models/anonymous_user.rb +++ b/app/models/anonymous_user.rb @@ -91,4 +91,8 @@ class AnonymousUser def blacklisted_tags_array CONFIG["default_blacklists"] end + + def last_forum_topic_read_at + Time.now + end end diff --git a/app/views/layouts/_menu.html.erb b/app/views/layouts/_menu.html.erb index 7e3cdfb3..28060532 100644 --- a/app/views/layouts/_menu.html.erb +++ b/app/views/layouts/_menu.html.erb @@ -204,7 +204,10 @@ +