Remove crash detection

This commit is contained in:
Thomas Weber committed 2021-03-12 21:27:13 -06:00
1 parent b67ef76d6f
commit e496ea0328
1 file changed
+7 -17
+7 -17
View File
@@ -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 () {