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

Function waitForSearchInput

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

Source from the content-addressed store, hash-verified

266}
267
268function waitForSearchInput() {
269 const startTime = Date.now();
270
271 return new Promise((resolve) => {
272 const check = () => {
273 const searchInput = getSearchInput();
274 if (searchInput || Date.now() - startTime >= SEARCH_INPUT_WAIT_TIMEOUT) {
275 resolve(searchInput);
276 return;
277 }
278
279 requestAnimationFrame(check);
280 };
281
282 check();
283 });
284}
285
286export async function openWithSearch(query) {
287 Sidebar.show();

Callers 1

openWithSearchFunction · 0.85

Calls 1

checkFunction · 0.70

Tested by

no test coverage detected