22 lines
492 B
JavaScript
22 lines
492 B
JavaScript
|
|
/**
|
||
|
|
* Shared bridge for scheduling fsLightbox refresh calls without global window APIs.
|
||
|
|
*/
|
||
|
|
let refreshPending = false;
|
||
|
|
|
||
|
|
export const requestFsLightboxRefresh = () => {
|
||
|
|
if (typeof window.refreshFsLightbox === 'function') {
|
||
|
|
window.refreshFsLightbox();
|
||
|
|
refreshPending = false;
|
||
|
|
return true;
|
||
|
|
}
|
||
|
|
refreshPending = true;
|
||
|
|
return false;
|
||
|
|
};
|
||
|
|
|
||
|
|
export const flushPendingFsLightboxRefresh = () => {
|
||
|
|
if (!refreshPending) {
|
||
|
|
return false;
|
||
|
|
}
|
||
|
|
return requestFsLightboxRefresh();
|
||
|
|
};
|