DEV: No longer preload categories (#24950)

Categories will no longer be preloaded when `lazy_load_categories` is
enabled through PreloadStore.

Instead, the list of site categories will continue to be populated
by `Site.updateCategory` as more and more categories are being loaded
from different sources (topic lists, category selectors, etc).
This commit is contained in:
Bianca Nenciu
2023-12-28 14:36:33 +02:00
committed by GitHub
parent c4396c6acf
commit 14269232ba
8 changed files with 17 additions and 22 deletions

View File

@@ -4,9 +4,6 @@
class Site
include ActiveModel::Serialization
# Number of categories preloaded when lazy_load_categories is enabled
LAZY_LOAD_CATEGORIES_LIMIT = 10
cattr_accessor :preloaded_category_custom_fields
def self.reset_preloaded_category_custom_fields
@@ -157,11 +154,7 @@ class Site
self.class.categories_callbacks.each { |callback| callback.call(categories, @guardian) }
if SiteSetting.lazy_load_categories
categories[0...Site::LAZY_LOAD_CATEGORIES_LIMIT]
else
categories
end
categories
end
end