Update index.js

This commit is contained in:
Rick Companje 2021-06-06 22:22:06 +02:00
parent 65090eecab
commit eea4651a9d

View File

@ -52,7 +52,7 @@ const history = syncHistoryWithStore(envs.platform === 'ios-app' ? hashHistory :
window.onbeforeunload = event => { window.onbeforeunload = event => {
const state = store.getState(); const state = store.getState();
if (state.files.current.unSavedData) { if (state.files.current && state.files.current.unSavedData) {
event.returnValue = 'You have unsaved work'; event.returnValue = 'You have unsaved work';
return event.returnValue; return event.returnValue;
} }