From d9f67e86d991549dbf19b30f7319b12f7e55b138 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Tue, 5 May 2020 20:17:49 +0200 Subject: [PATCH] Fix get_active_theme to return proper theme for user --- app/helpers/theme_helper.rb | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/app/helpers/theme_helper.rb b/app/helpers/theme_helper.rb index 99e1ce7d..fea46af3 100644 --- a/app/helpers/theme_helper.rb +++ b/app/helpers/theme_helper.rb @@ -47,14 +47,18 @@ module ThemeHelper end def get_active_theme - if current_user&.theme - current_user.theme - elsif @user&.theme + if @user&.theme if user_signed_in? - @user.theme unless !current_user&.show_foreign_themes? + if current_user&.show_foreign_themes? + @user.theme + else + current_user&.theme + end else @user.theme end + elsif current_user&.theme + current_user.theme end end