Skip to content

Commit

Permalink
Improved: clearing the currentMaargJob from state when changing the p…
Browse files Browse the repository at this point in the history
…age (#734)
  • Loading branch information
amansinghbais committed Dec 10, 2024
1 parent 1d06675 commit 7b561a4
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/store/modules/maargJob/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@ const actions: ActionTree<JobState, RootState> = {
return currentMaargJob;
},

async clearCurrentMaargJob({ commit }) {
commit(types.MAARGJOB_CURRENT_UPDATED, {});
},

async clearMaargJobState({ commit }) {
commit(types.MAARGJOB_ENUMS_UPDATED, {});
}
Expand Down
5 changes: 4 additions & 1 deletion src/views/Fulfillment.vue
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ export default defineComponent({
this.router.push({ name: 'JobDetails', params: { jobId: this.currentMaargJob.jobTypeEnumId, category: "fulfillment-maarg" } });
return;
}
if(!this.isJobDetailAnimationCompleted) {
emitter.emit('playAnimation');
this.isJobDetailAnimationCompleted = true;
Expand All @@ -380,6 +380,9 @@ export default defineComponent({
emitter.off("productStoreOrConfigChanged", this.fetchJobs);
emitter.off('viewJobConfiguration', this.viewJobConfiguration)
},
async ionViewWillLeave() {
await this.store.dispatch("maargJob/clearCurrentMaargJob");
},
setup() {
const store = useStore();
const router = useRouter();
Expand Down
3 changes: 3 additions & 0 deletions src/views/Inventory.vue
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,9 @@ export default defineComponent({
emitter.off("productStoreOrConfigChanged", this.fetchData);
emitter.off('viewJobConfiguration', this.viewJobConfiguration)
},
async ionViewWillLeave() {
await this.store.dispatch("maargJob/clearCurrentMaargJob");
},
setup() {
const store = useStore();
const router = useRouter();
Expand Down
3 changes: 3 additions & 0 deletions src/views/JobDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ export default defineComponent({
}
})
},
async ionViewWillLeave() {
await this.store.dispatch("maargJob/clearCurrentMaargJob");
},
setup() {
const store = useStore();
Expand Down
5 changes: 4 additions & 1 deletion src/views/Miscellaneous.vue
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,10 @@ export default defineComponent({
emitter.emit('playAnimation');
this.isJobDetailAnimationCompleted = true;
}
}
},
},
async ionViewWillLeave() {
await this.store.dispatch("maargJob/clearCurrentMaargJob");
},
setup() {
const store = useStore();
Expand Down
3 changes: 3 additions & 0 deletions src/views/Orders.vue
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,9 @@ export default defineComponent({
emitter.off("productStoreOrConfigChanged", this.fetchJobs);
emitter.off('viewJobConfiguration', this.viewJobConfiguration)
},
async ionViewWillLeave() {
await this.store.dispatch("maargJob/clearCurrentMaargJob");
},
setup() {
const store = useStore();
const router = useRouter();
Expand Down
3 changes: 3 additions & 0 deletions src/views/Pipeline.vue
Original file line number Diff line number Diff line change
Expand Up @@ -708,6 +708,9 @@ export default defineComponent({
emitter.off('jobUpdated', this.updateJobs);
emitter.off("pinnedJobsUpdated", (this as any).updateSelectedPinnedJob);
},
async ionViewWillLeave() {
await this.store.dispatch("maargJob/clearCurrentMaargJob");
},
setup() {
const router = useRouter();
const store = useStore();
Expand Down
3 changes: 3 additions & 0 deletions src/views/PreOrder.vue
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,9 @@ export default defineComponent({
emitter.on('viewJobConfiguration', this.viewJobConfiguration)
emitter.off("productStoreOrConfigChanged", this.fetchJobs);
},
async ionViewWillLeave() {
await this.store.dispatch("maargJob/clearCurrentMaargJob");
},
setup() {
const store = useStore();
const router = useRouter();
Expand Down

0 comments on commit 7b561a4

Please sign in to comment.