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

Function loadExplore

src/sidebarApps/extensions/index.js:463–498  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

461}
462
463async function loadExplore() {
464 if (this.collapsed) return;
465
466 const status = await helpers.checkAPIStatus();
467 if (!status) {
468 $explore.$ul.content = <span className="error">{strings.api_error}</span>;
469 return;
470 }
471
472 try {
473 startLoading($explore);
474 currentPage = 1;
475 hasMore = true;
476
477 const response = await fetch(
478 withSupportedEditor(
479 `${config.API_BASE}/plugins?page=${currentPage}&limit=${LIMIT}`,
480 ),
481 );
482 const plugins = await response.json();
483
484 if (plugins.length < LIMIT) {
485 hasMore = false;
486 }
487
488 installedPlugins = await listInstalledPlugins();
489 $explore.$ul.content = plugins.map(ListItem);
490 currentPage++;
491 updateHeight($explore);
492 } catch (error) {
493 console.error("Failed to load plugins in sidebar explore:", error);
494 $explore.$ul.content = <span className="error">{strings.error}</span>;
495 } finally {
496 stopLoading($explore);
497 }
498}
499
500async function listInstalledPlugins() {
501 const plugins = await Promise.all(

Callers

nothing calls this directly

Calls 6

listInstalledPluginsFunction · 0.85
updateHeightFunction · 0.85
startLoadingFunction · 0.70
withSupportedEditorFunction · 0.70
stopLoadingFunction · 0.70
errorMethod · 0.45

Tested by

no test coverage detected