This commit is contained in:
BoHung Chiu 2022-04-13 23:26:01 +08:00
parent 7530a44da4
commit a8bc48eef4
2 changed files with 2 additions and 2 deletions

View File

@ -28,7 +28,7 @@ class Admin::AnnouncementsController < OrbitAdminController
def update_sort_setting
setting = @announcement_setting
setting.update_attributes(settings_params)
if defined?(OrbitHelper::SharedHash)
if defined?(OrbitHelper::SharedHash) && OrbitHelper::SharedHash
OrbitHelper::SharedHash['announcement'][:enable_manually_sort] = setting.enable_manually_sort
end
redirect_to edit_sort_admin_announcement_path

View File

@ -9,7 +9,7 @@ class AnnouncementsController < ApplicationController
end
def manually_sort
if defined?(OrbitHelper::SharedHash)
if defined?(OrbitHelper::SharedHash) && OrbitHelper::SharedHash
OrbitHelper::SharedHash['announcement'][:enable_manually_sort] rescue AnnouncementSetting.first.enable_manually_sort
else
AnnouncementSetting.first.enable_manually_sort rescue false