From b1f6ee58b3c8a61cd39431ef38dce20c68b68a40 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Thu, 7 Mar 2024 16:11:08 +0900 Subject: fix an issue where answer link is not active in answer list page --- services/app/src/App.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/app/src/App.php b/services/app/src/App.php index 3eedfe7..2eb6797 100644 --- a/services/app/src/App.php +++ b/services/app/src/App.php @@ -282,8 +282,8 @@ final class App if ($quiz === null) { throw new HttpNotFoundException($request); } + $currentUser = $this->getCurrentUser($request); if ($quiz->isRankingHidden()) { - $currentUser = $this->getCurrentUser($request); if ($currentUser === null) { $answers = []; } else { @@ -299,7 +299,7 @@ final class App 'answers' => $answers, 'is_ranking_hidden' => $quiz->isRankingHidden(), 'is_open' => $quiz->isOpenToAnswer(), - 'current_user_id' => isset($currentUser) ? $currentUser->user_id : null, + 'current_user_id' => $currentUser?->user_id, ]); } -- cgit v1.2.3-70-g09d2