Skip to content

Commit

Permalink
Clear notifications like import template does
Browse files Browse the repository at this point in the history
  • Loading branch information
nickpalladino committed Nov 7, 2023
1 parent 8f5ef30 commit af97578
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/views/trait/TraitsImport.vue
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ import {Trait} from "@/breeding-insight/model/Trait";
import {ProgramUpload} from "@/breeding-insight/model/ProgramUpload";
import {AxiosResponse} from "axios";
import {DataFormEventBusHandler} from "@/components/forms/DataFormEventBusHandler";
import {DEACTIVATE_ALL_NOTIFICATIONS} from "@/store/mutation-types";

enum ImportState {
CHOOSE_FILE = "CHOOSE_FILE",
Expand Down Expand Up @@ -288,6 +289,7 @@ export default class TraitsImport extends ProgramsBase {
}

upload() {
this.$store.commit(DEACTIVATE_ALL_NOTIFICATIONS);
TraitUploadService.uploadFile(this.activeProgram!.id!, this.file!).then((response) => {
let count = 0;
let traits: Trait[] = [];
Expand All @@ -312,6 +314,7 @@ export default class TraitsImport extends ProgramsBase {
}

abort() {
this.$store.commit(DEACTIVATE_ALL_NOTIFICATIONS);
// TODO: actually cancel request
this.showCancelledNotification();
}
Expand Down Expand Up @@ -340,6 +343,7 @@ export default class TraitsImport extends ProgramsBase {
}

async confirm() {
this.$store.commit(DEACTIVATE_ALL_NOTIFICATIONS);
const name = this.activeProgram && this.activeProgram.name ? this.activeProgram.name : 'the program';
try {
// fetch uploaded traits
Expand Down

0 comments on commit af97578

Please sign in to comment.