From 6a455ea72b19066f4931d0dfa1b3601fd972c81f Mon Sep 17 00:00:00 2001 From: dannysindra Date: Thu, 12 Jan 2023 17:48:28 -0800 Subject: [PATCH 1/2] fix handleLoad call --- src/Frame.jsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Frame.jsx b/src/Frame.jsx index ae88480..37f0f1c 100644 --- a/src/Frame.jsx +++ b/src/Frame.jsx @@ -95,9 +95,12 @@ export class Frame extends Component { // In certain situations on a cold cache DOMContentLoaded never gets called // fallback to an interval to check if that's the case - loadCheck = setInterval(function loadCheckCallback() { - this.handleLoad(); - }, 500); + loadCheck = () => { + const self = this; + setInterval(() => { + self.handleLoad(); + }, 500); + }; renderFrameContents() { if (!this._isMounted) { From 962f0a999baca359563ca376296785a3f04e8393 Mon Sep 17 00:00:00 2001 From: dannysindra Date: Thu, 12 Jan 2023 17:56:52 -0800 Subject: [PATCH 2/2] nit --- src/Frame.jsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Frame.jsx b/src/Frame.jsx index 37f0f1c..8470f30 100644 --- a/src/Frame.jsx +++ b/src/Frame.jsx @@ -95,12 +95,10 @@ export class Frame extends Component { // In certain situations on a cold cache DOMContentLoaded never gets called // fallback to an interval to check if that's the case - loadCheck = () => { - const self = this; + loadCheck = () => setInterval(() => { - self.handleLoad(); + this.handleLoad(); }, 500); - }; renderFrameContents() { if (!this._isMounted) {