@hmcts/ccd-case-ui-toolkit 7.3.98-exui-4454-2 → 7.3.98-exui-4454-3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -9349,6 +9349,8 @@ class RetryUtil {
|
|
|
9349
9349
|
type: Injectable
|
|
9350
9350
|
}], null, null); })();
|
|
9351
9351
|
|
|
9352
|
+
const MEDIA_VIEWER_HANDOFF_RETRY_INTERVAL_MS = 100;
|
|
9353
|
+
const MEDIA_VIEWER_HANDOFF_MAX_ATTEMPTS = 100;
|
|
9352
9354
|
class WindowService {
|
|
9353
9355
|
locationAssign(url) {
|
|
9354
9356
|
window.location.assign(url);
|
|
@@ -9398,7 +9400,7 @@ class WindowService {
|
|
|
9398
9400
|
};
|
|
9399
9401
|
window.addEventListener('message', acknowledgementListener);
|
|
9400
9402
|
const send = () => {
|
|
9401
|
-
if (acknowledged || openedWindow.closed || attempts++ >=
|
|
9403
|
+
if (acknowledged || openedWindow.closed || attempts++ >= MEDIA_VIEWER_HANDOFF_MAX_ATTEMPTS) {
|
|
9402
9404
|
window.removeEventListener('message', acknowledgementListener);
|
|
9403
9405
|
if (!openedWindow.closed) {
|
|
9404
9406
|
openedWindow.opener = null;
|
|
@@ -9406,7 +9408,7 @@ class WindowService {
|
|
|
9406
9408
|
return;
|
|
9407
9409
|
}
|
|
9408
9410
|
openedWindow.postMessage(handoff, targetOrigin);
|
|
9409
|
-
retryTimer = window.setTimeout(send,
|
|
9411
|
+
retryTimer = window.setTimeout(send, MEDIA_VIEWER_HANDOFF_RETRY_INTERVAL_MS);
|
|
9410
9412
|
};
|
|
9411
9413
|
send();
|
|
9412
9414
|
}
|