Remove crash detection
This commit is contained in:
1 file changed
+7
-17
@@ -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 () {
|
||||
|
||||
Reference in new issue
Block a user