MCPcopy Index your code
hub / github.com/MALSync/MALSync / waitForPageToBeVisible

Function waitForPageToBeVisible

src/utils/general.ts:877–890  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

875}
876
877export function waitForPageToBeVisible() {
878 const condition = () =>
879 Boolean(!document.visibilityState || document.visibilityState === 'visible');
880
881 if (condition()) return Promise.resolve();
882
883 con.log('Page in background');
884
885 const { asyncWaitUntilTrue: awaitUi } = getAsyncWaitUntilTrue(() => condition());
886
887 return awaitUi().then(() => {
888 con.log('Page is visible');
889 });
890}
891
892export async function clearCache() {
893 const cacheObj = await api.storage.list();

Callers 4

initMethod · 0.90
initMethod · 0.90
initMethod · 0.90
initMethod · 0.90

Calls 2

conditionFunction · 0.85
getAsyncWaitUntilTrueFunction · 0.85

Tested by

no test coverage detected