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

Method refreshFolder

src/components/fileTree/index.js:344–357  ·  view source on GitHub ↗

* Refresh a loaded folder in this tree or one of its expanded child trees. * @param {string} url * @param {(a: string, b: string) => boolean} [isSameUrl] * @returns {Promise }

(url, isSameUrl = (a, b) => a === b)

Source from the content-addressed store, hash-verified

342 * @returns {Promise<boolean>}
343 */
344 async refreshFolder(url, isSameUrl = (a, b) => a === b) {
345 if (this.currentUrl && isSameUrl(this.currentUrl, url)) {
346 await this.refresh();
347 return true;
348 }
349
350 for (const childTree of this.childTrees.values()) {
351 if (await childTree.refreshFolder(url, isSameUrl)) {
352 return true;
353 }
354 }
355
356 return false;
357 }
358
359 /**
360 * Destroy all expanded child trees and clear their references.

Callers 1

refreshOpenFolderFunction · 0.80

Calls 1

refreshMethod · 0.95

Tested by

no test coverage detected