diff --git a/src/components/Tutorial.vue b/src/components/Tutorial.vue index 354193dbd..ef2fa6e2c 100644 --- a/src/components/Tutorial.vue +++ b/src/components/Tutorial.vue @@ -98,7 +98,18 @@ const { openSnackbar } = useSnackbar() const interfaceStore = useAppInterfaceStore() const vehicleStore = useMainVehicleStore() -const showTutorial = ref(true) +const props = defineProps<{ + /** + * Parent-controlled trigger for showing the dialog. + */ + modelValue: boolean +}>() + +const emit = defineEmits<{ + (e: 'update:modelValue', value: boolean): void +}>() + +const showTutorial = ref(false || props.modelValue) const currentTutorialStep = useStorage('cockpit-last-tutorial-step', 1) const isVehicleConnectedVisible = ref(false) const tallContent = ref(false) @@ -208,7 +219,6 @@ const handleStepChange = (newStep: number): void => { interfaceStore.componentToHighlight = 'menu-trigger' interfaceStore.currentSubMenuComponentName = null interfaceStore.currentSubMenuName = null - interfaceStore.userHasSeenTutorial = false break case 3: interfaceStore.isMainMenuVisible = true @@ -216,7 +226,6 @@ const handleStepChange = (newStep: number): void => { interfaceStore.currentSubMenuName = SubMenuName.settings interfaceStore.componentToHighlight = 'settings-menu-item' interfaceStore.currentSubMenuComponentName = null - interfaceStore.userHasSeenTutorial = false break case 4: interfaceStore.isMainMenuVisible = true @@ -224,7 +233,6 @@ const handleStepChange = (newStep: number): void => { interfaceStore.currentSubMenuName = SubMenuName.settings interfaceStore.currentSubMenuComponentName = SubMenuComponentName.SettingsGeneral tallContent.value = true - interfaceStore.userHasSeenTutorial = false interfaceStore.componentToHighlight = 'General' break case 5: @@ -232,7 +240,6 @@ const handleStepChange = (newStep: number): void => { interfaceStore.mainMenuCurrentStep = 2 interfaceStore.currentSubMenuName = SubMenuName.settings interfaceStore.currentSubMenuComponentName = SubMenuComponentName.SettingsGeneral - interfaceStore.userHasSeenTutorial = false tallContent.value = false interfaceStore.componentToHighlight = 'vehicle-address' setVehicleConnectedVisible() @@ -243,7 +250,6 @@ const handleStepChange = (newStep: number): void => { interfaceStore.currentSubMenuName = SubMenuName.settings interfaceStore.currentSubMenuComponentName = SubMenuComponentName.SettingsInterface tallContent.value = false - interfaceStore.userHasSeenTutorial = false interfaceStore.componentToHighlight = 'Interface' break case 7: @@ -251,7 +257,6 @@ const handleStepChange = (newStep: number): void => { interfaceStore.mainMenuCurrentStep = 2 interfaceStore.currentSubMenuName = SubMenuName.settings interfaceStore.currentSubMenuComponentName = SubMenuComponentName.SettingsJoystick - interfaceStore.userHasSeenTutorial = false tallContent.value = true interfaceStore.componentToHighlight = 'Joystick' break @@ -260,7 +265,6 @@ const handleStepChange = (newStep: number): void => { interfaceStore.mainMenuCurrentStep = 2 interfaceStore.currentSubMenuName = SubMenuName.settings interfaceStore.currentSubMenuComponentName = SubMenuComponentName.SettingsVideo - interfaceStore.userHasSeenTutorial = false tallContent.value = true interfaceStore.componentToHighlight = 'Video' break @@ -269,7 +273,6 @@ const handleStepChange = (newStep: number): void => { interfaceStore.mainMenuCurrentStep = 2 interfaceStore.currentSubMenuName = SubMenuName.settings interfaceStore.currentSubMenuComponentName = SubMenuComponentName.SettingsTelemetry - interfaceStore.userHasSeenTutorial = false tallContent.value = false interfaceStore.isGlassModalAlwaysOnTop = true interfaceStore.componentToHighlight = 'Telemetry' @@ -279,7 +282,6 @@ const handleStepChange = (newStep: number): void => { interfaceStore.mainMenuCurrentStep = 2 interfaceStore.currentSubMenuName = SubMenuName.settings interfaceStore.currentSubMenuComponentName = SubMenuComponentName.SettingsAlerts - interfaceStore.userHasSeenTutorial = false tallContent.value = false interfaceStore.isGlassModalAlwaysOnTop = false interfaceStore.componentToHighlight = 'Alerts' @@ -289,7 +291,6 @@ const handleStepChange = (newStep: number): void => { interfaceStore.mainMenuCurrentStep = 2 interfaceStore.currentSubMenuName = SubMenuName.settings interfaceStore.currentSubMenuComponentName = SubMenuComponentName.SettingsDev - interfaceStore.userHasSeenTutorial = false tallContent.value = true interfaceStore.isGlassModalAlwaysOnTop = false interfaceStore.componentToHighlight = 'Dev' @@ -299,7 +300,6 @@ const handleStepChange = (newStep: number): void => { interfaceStore.mainMenuCurrentStep = 2 interfaceStore.currentSubMenuName = SubMenuName.settings interfaceStore.currentSubMenuComponentName = SubMenuComponentName.SettingsMission - interfaceStore.userHasSeenTutorial = false tallContent.value = false interfaceStore.isGlassModalAlwaysOnTop = false interfaceStore.componentToHighlight = 'Mission' @@ -316,6 +316,7 @@ const handleStepChange = (newStep: number): void => { const dontShowTutorialAgain = (): void => { interfaceStore.userHasSeenTutorial = true showTutorial.value = false + emit('update:modelValue', false) currentTutorialStep.value = 1 openSnackbar({ message: 'This guide can be reopened via the Settings > General menu', @@ -332,7 +333,6 @@ const alwaysShowTutorialOnStartup = (): void => { const nextTutorialStep = (): void => { if (currentTutorialStep.value === steps.length) { - dontShowTutorialAgain() closeTutorial() return } @@ -348,8 +348,8 @@ const backTutorialStep = (): void => { const closeTutorial = (): void => { showTutorial.value = false interfaceStore.componentToHighlight = 'none' - interfaceStore.userHasSeenTutorial = true interfaceStore.isTutorialVisible = false + emit('update:modelValue', false) } const setVehicleConnectedVisible = (): void => { diff --git a/src/components/UpdateNotification.vue b/src/components/UpdateNotification.vue index c79521856..5ba294def 100644 --- a/src/components/UpdateNotification.vue +++ b/src/components/UpdateNotification.vue @@ -1,6 +1,6 @@ +