Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (this.origConsoleError) {
window.console.error = this.origConsoleError;
}
shortcuts.forEach(({ key, action }) => {
if (Actions[action]) {
Mousetrap.unbind(key);
}
});
this.pxmSub.unsubscribe();
this.renderListener.removeListeners();
},
methods: Object.assign(
mapMutations({
showApp: Mutations.SHOW_APP,
showLanding: Mutations.SHOW_LANDING,
toggleLanding() {
if (this.landingVisible) {
this.showApp();
} else {
this.showLanding();
}
},
}),
mapActions({
promptUserFiles: Actions.PROMPT_FOR_FILES,
openSample: (dispatch, urls, names) => {
// dispatch: delete all loaded files since this is only called
// by clicking on sample data
dispatch(Actions.OPEN_REMOTE_FILES, { urls, names }).then(() =>
closeAndTryToLoad(commit) {
const allFilesErrored = this.files.reduce(
(flag, { error }) => flag && error,
true
);
if (!allFilesErrored) {
commit(Mutations.SHOW_APP);
}
commit(Mutations.FILE_IDLE);
},
}),
function onLoadOkay(commit) {
commit(Mutations.FILE_IDLE);
commit(Mutations.SHOW_APP);
}
function onRoute(event) {
const state = event.state || {};
if (state.app) {
store.commit(Mutations.SHOW_APP);
} else {
store.commit(Mutations.SHOW_LANDING);
}
}
store.watch(