MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / loadFilteredPlugins

Function loadFilteredPlugins

src/sidebarApps/extensions/index.js:177–213  ·  view source on GitHub ↗
(filterState, isInitial = false)

Source from the content-addressed store, hash-verified

175}
176
177async function loadFilteredPlugins(filterState, isInitial = false) {
178 if (isFilterLoading || !filterHasMore || !filterState) return;
179
180 try {
181 isFilterLoading = true;
182
183 const { items, hasMore } = await getFilteredPlugins(filterState);
184
185 if (currentFilter !== filterState) {
186 return;
187 }
188
189 installedPlugins = await listInstalledPlugins();
190 const pluginElements = items.map(ListItem);
191 if (pluginElements.length) {
192 $searchResult.append(...pluginElements);
193 } else if (isInitial) {
194 $searchResult.append(
195 <span className="error empty">
196 {strings["no plugins found"] || strings.empty || "No plugins found"}
197 </span>,
198 );
199 }
200
201 filterHasMore = hasMore;
202 if (!filterHasMore) {
203 $searchResult.onscroll = null;
204 }
205
206 updateHeight($searchResult);
207 } catch (error) {
208 window.log("error", "Error loading filtered plugins:");
209 window.log("error", error);
210 } finally {
211 isFilterLoading = false;
212 }
213}
214
215async function searchPlugin() {
216 clearTimeout(searchTimeout);

Callers 2

handleFilterScrollFunction · 0.85
filterPluginsFunction · 0.85

Calls 5

listInstalledPluginsFunction · 0.85
updateHeightFunction · 0.85
appendMethod · 0.80
logMethod · 0.80
getFilteredPluginsFunction · 0.70

Tested by

no test coverage detected