From 39c85451fca7499ae91a69a420b04a43b2ef3adc Mon Sep 17 00:00:00 2001 From: veselcraft Date: Thu, 26 May 2022 15:26:38 +0300 Subject: [PATCH] Notifications: Fix code style + little bit of performance --- Web/Presenters/NotificationPresenter.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Web/Presenters/NotificationPresenter.php b/Web/Presenters/NotificationPresenter.php index 68d66028..d12f27f0 100644 --- a/Web/Presenters/NotificationPresenter.php +++ b/Web/Presenters/NotificationPresenter.php @@ -8,7 +8,7 @@ final class NotificationPresenter extends OpenVKPresenter $this->assertUserLoggedIn(); $archive = $this->queryParam("act") === "archived"; - $count = $this->user->identity->getNotificationsCount($archive); + $count = $this->user->identity->getNotificationsCount($archive); if($count == 0 && $this->queryParam("act") == NULL) { $mode = "archived"; @@ -20,7 +20,7 @@ final class NotificationPresenter extends OpenVKPresenter $this->template->mode = $mode; $this->template->page = (int) ($this->queryParam("p") ?? 1); $this->template->iterator = iterator_to_array($this->user->identity->getNotifications($this->template->page, $archive)); - $this->template->count = $this->user->identity->getNotificationsCount($archive); + $this->template->count = $count; $this->user->identity->updateNotificationOffset(); $this->user->identity->save();