From e496ea0328316d2ad96b25b46bb886a07b199185 Mon Sep 17 00:00:00 2001 From: Thomas Weber Date: Fri, 12 Mar 2021 21:27:13 -0600 Subject: [PATCH] Remove crash detection --- src/lib/tw-editor-warning-hoc.jsx | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/src/lib/tw-editor-warning-hoc.jsx b/src/lib/tw-editor-warning-hoc.jsx index 526f9c08a..3734512fe 100644 --- a/src/lib/tw-editor-warning-hoc.jsx +++ b/src/lib/tw-editor-warning-hoc.jsx @@ -7,28 +7,18 @@ let shownWarning = false; const DIRTY_KEY = 'tw:dirty'; +// Attempt to clean up old values from local storage (temporary) +try { + localStorage.removeItem(DIRTY_KEY); +} catch (e) { + // ignore +} + const TWEditorWarningHOC = function (WrappedComponent) { class EditorWarningComponent extends React.Component { componentDidMount () { - // This makes it so that if the VM ever is unable to finish a frame, we may be able to detect it. - // This isn't foolproof, but it's better than nothing. - this.props.vm.runtime.beforeStep = () => { - if (!this.props.isPlayerOnly && !document.hidden) { - localStorage.setItem(DIRTY_KEY, '1'); - } - }; - this.props.vm.runtime.afterStep = () => { - if (!this.props.isPlayerOnly && !document.hidden) { - localStorage.setItem(DIRTY_KEY, '0'); - } - }; - if (!shownWarning) { this.showWarningIfInEditor(); - - if (localStorage.getItem(DIRTY_KEY) === '1') { - this.props.onShowRecovery(); - } } } shouldComponentUpdate () {