From a6dc7661eeb0617eae46bc88f375cb89dd8d032e Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Thu, 30 Dec 2021 01:41:27 +0100 Subject: [PATCH] Extend theme helper to show themes on answer pages --- app/helpers/theme_helper.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/helpers/theme_helper.rb b/app/helpers/theme_helper.rb index 2ba9d186..5ccb139a 100644 --- a/app/helpers/theme_helper.rb +++ b/app/helpers/theme_helper.rb @@ -76,6 +76,16 @@ module ThemeHelper else @user.theme end + elsif @answer&.user&.theme + if user_signed_in? + if current_user&.show_foreign_themes? + @answer.user.theme + else + current_user&.theme + end + else + @answer.user.theme + end elsif current_user&.theme current_user.theme end