()
| 266 | } |
| 267 | |
| 268 | function 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 | |
| 286 | export async function openWithSearch(query) { |
| 287 | Sidebar.show(); |
no test coverage detected