diff --git a/app/controllers/blubber.php b/app/controllers/blubber.php index 4341b73576e5a9b3d71329685f6cda81460c5635..06390970c5ee5924e5b792675bedf857731cef95 100644 --- a/app/controllers/blubber.php +++ b/app/controllers/blubber.php @@ -47,16 +47,16 @@ class BlubberController extends AuthenticatedController $this->thread = array_pop($threads); } + $this->thread_data = []; if ($this->thread) { $this->thread->markAsRead(); + $this->thread_data = $this->thread->getJSONData( + 50, + null, + Request::get("search") + ); } - $this->thread_data = $this->thread->getJSONData( - 50, - null, - Request::get("search") - ); - if (!Avatar::getAvatar($GLOBALS['user']->id)->is_customized() && !$_SESSION['already_asked_for_avatar']) { $_SESSION['already_asked_for_avatar'] = true; PageLayout::postInfo(sprintf( diff --git a/app/views/blubber/index.php b/app/views/blubber/index.php index 7392fa466385cfb4d0b16b214152a4f82b568085..0055f97fa0eefbaca99877c5fdf36d750cac389d 100644 --- a/app/views/blubber/index.php +++ b/app/views/blubber/index.php @@ -1,5 +1,5 @@ <div class="blubber_panel" - data-active_thread="<?= htmlReady($thread->getId()) ?>" + data-active_thread="<?= htmlReady(!empty($thread) ? $thread->getId() : '') ?>" data-thread_data="<?= htmlReady(json_encode($thread_data ?: ['thread_posting' => []])) ?>" data-threads_more_down="<?= htmlReady($threads_more_down) ?>" :class="waiting ? 'waiting' : ''" v-cloak>