diff --git a/src/components/editor.vue b/src/components/editor.vue index b56a13762..7379ae69c 100644 --- a/src/components/editor.vue +++ b/src/components/editor.vue @@ -290,6 +290,9 @@ ref="slide" :configFileStructure="configFileStructure" :currentSlide="currentSlide" + :otherLangSlide=" + slides[slideIndex]?.[slides.find((slide) => slide.fr === currentSlide) ? 'en' : 'fr'] + " :lang="slides.find((slide) => slide.fr === currentSlide) ? 'fr' : 'en'" :slideIndex="slideIndex" :isLast="slideIndex === slides.length - 1" @@ -340,8 +343,8 @@ import { Slide, SourceCounts, StoryRampConfig, - TextPanel, - VideoPanel + SupportedLanguages, + TextPanel } from '@/definitions'; import { VueSpinnerOval } from 'vue3-spinners'; import axios from 'axios'; @@ -458,7 +461,7 @@ export default class EditorV extends Vue { /** * Change current slide to selected slide. */ - selectSlide(index: number, lang?: string): void { + selectSlide(index: number, lang?: SupportedLanguages): void { // save changes to current slide before changing slides if (this.$refs.slide !== undefined) { (this.$refs.slide as SlideEditorV).saveChanges(); @@ -481,7 +484,10 @@ export default class EditorV extends Vue { } else { const selectedLang = newLang as keyof MultiLanguageSlide; const selectedSlide = this.loadSlides[index][selectedLang]; - this.currentSlide = selectedSlide ?? ''; + + // If the requested language config for a slide doesn't exist, open the other language + // This edge case should ONLY pop up while using the "Next/Previous Slide" buttons + this.currentSlide = selectedSlide ?? this.loadSlides[index][selectedLang === 'en' ? 'fr' : 'en'] ?? ''; } this.slideIndex = index; (this.$refs.slide as SlideEditorV).panelIndex = 0; diff --git a/src/components/helpers/action-modal.vue b/src/components/helpers/action-modal.vue index 120967340..d7a7d9a3a 100644 --- a/src/components/helpers/action-modal.vue +++ b/src/components/helpers/action-modal.vue @@ -1,20 +1,25 @@