A free, self-hostable news aggregator…
Speed: disable labels count for Ajax requests (#8352)
Alexandre Alapetiteb8c955583cae
diff --git a/app/Controllers/indexController.php b/app/Controllers/indexController.phpindex 732e4248a..0d704c496 100644--- a/app/Controllers/indexController.php+++ b/app/Controllers/indexController.php@@ -149,8 +149,13 @@ class FreshRSS_index_Controller extends FreshRSS_ActionController {}$this->view->callbackBeforeFeeds = static function (FreshRSS_View $view) {- $view->tags = FreshRSS_Context::labels(true);$view->nbUnreadTags = 0;+ if (Minz_Request::paramBoolean('ajax')) {+ // Disable label counts for AJAX requests: faster and not needed+ $view->tags = FreshRSS_Context::labels(precounts: false);+ return;+ }+ $view->tags = FreshRSS_Context::labels(precounts: true);foreach ($view->tags as $tag) {$view->nbUnreadTags += $tag->nbUnread();}