Files
DiceCloud/app/imports/client/ui/dialogStack/dialogStackWindowEvents.js
2022-11-19 17:51:50 +02:00

12 lines
377 B
JavaScript

import store from '/imports/client/ui/vuexStore.js';
if (window) {
window.onpopstate = function (event) {
let state = event.state;
let numDialogs = store.state.dialogStack.dialogs.length;
if (Number.isFinite(state.openDialogs) && numDialogs > state.openDialogs) {
store.commit('popDialogStackMutation', store.state.dialogStack.currentResult);
}
};
}