Skip to content

Commit

Permalink
Merge pull request #913 from canada-ca/622-system-scoring-import
Browse files Browse the repository at this point in the history
fix #622 when loading old files
  • Loading branch information
MrDeshaies committed Feb 18, 2022
2 parents 4c63b4e + b98fbf8 commit 726262c
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/components/ActionButtonBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ import { Model } from "survey-vue";
// make saveJsonFile() declared in index.html available to TS
declare global {
interface Window {
saveJsonFile:any;
}
interface Window {
saveJsonFile: any;
}
}
@Component
Expand Down Expand Up @@ -116,6 +116,12 @@ export default class ActionButtonBar extends Vue {
}
const loadedFile: SurveyFile = JSON.parse(result);
// little conversion for older files before #622 was implemented
if ((loadedFile?.data as any)?.aboutSystem1?.includes("item6-1")) {
const aboutSystem = (loadedFile.data as any).aboutSystem1 as string[];
aboutSystem[aboutSystem.indexOf("item6-1")] = "item6";
}
this.$emit("fileLoaded", loadedFile);
};
Expand Down

0 comments on commit 726262c

Please sign in to comment.