Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix saving on metadata page #279

Merged
merged 1 commit into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/components/editor/editor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ export default class EditorV extends Vue {
created(): void {
this.loadSlides = this.slides;
this.uuid = this.$route.params.uid as string;

window.addEventListener('beforeunload', this.beforeWindowUnload);
}

Expand Down
6 changes: 5 additions & 1 deletion src/components/editor/metadata-editor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ interface RouteParams {
slides: Slide[];
sourceCounts: SourceCounts;
existing: boolean;
unsavedChanges: boolean;
}

@Options({
Expand Down Expand Up @@ -291,6 +292,7 @@ export default class MetadataEditorV extends Vue {
this.slides = props.slides;
this.sourceCounts = props.sourceCounts;
this.loadExisting = props.existing;
this.unsavedChanges = props.unsavedChanges;
// Load product logo (if provided).
const logo = this.configs[this.configLang]?.introSlide.logo?.src;
const logoSrc = `assets/${this.configLang}/${this.metadata.logoName}`;
Expand Down Expand Up @@ -810,7 +812,8 @@ export default class MetadataEditorV extends Vue {
sourceCounts: this.sourceCounts,
metadata: this.metadata,
slides: this.slides,
existing: this.editExisting
existing: this.editExisting,
unsavedChanges: this.unsavedChanges
};
}
});
Expand Down Expand Up @@ -839,6 +842,7 @@ export default class MetadataEditorV extends Vue {
if (this.loadExisting) {
if (this.configs[this.configLang] !== undefined && this.uuid === this.configFileStructure?.uuid) {
this.loadEditor = true;
this.saveMetadata(false);
this.updateEditorPath();
} else {
Message.error('No config exists for storylines product.');
Expand Down
Loading