1
1
import * as React from 'react'
2
2
import { useTranslation } from 'react-i18next'
3
+ import { useDispatch } from 'react-redux'
3
4
4
5
import {
5
6
COLORS ,
@@ -14,10 +15,12 @@ import { useCreateLiveCommandMutation } from '@opentrons/react-api-client'
14
15
15
16
import { SmallButton } from '../../atoms/buttons'
16
17
import { Modal } from '../../molecules/Modal'
18
+ import { updateConfigValue } from '../../redux/config'
17
19
18
20
import welcomeModalImage from '../../assets/images/on-device-display/welcome_dashboard_modal.png'
19
21
20
22
import type { SetStatusBarCreateCommand } from '@opentrons/shared-data'
23
+ import type { Dispatch } from '../../redux/types'
21
24
22
25
interface WelcomeModalProps {
23
26
setShowWelcomeModal : ( showWelcomeModal : boolean ) => void
@@ -27,6 +30,7 @@ export function WelcomeModal({
27
30
setShowWelcomeModal,
28
31
} : WelcomeModalProps ) : JSX . Element {
29
32
const { t } = useTranslation ( [ 'device_details' , 'shared' ] )
33
+ const dispatch = useDispatch < Dispatch > ( )
30
34
31
35
const { createLiveCommand } = useCreateLiveCommandMutation ( )
32
36
const animationCommand : SetStatusBarCreateCommand = {
@@ -44,6 +48,12 @@ export function WelcomeModal({
44
48
}
45
49
46
50
const handleCloseModal = ( ) : void => {
51
+ dispatch (
52
+ updateConfigValue (
53
+ 'onDeviceDisplaySettings.unfinishedUnboxingFlowRoute' ,
54
+ null
55
+ )
56
+ )
47
57
setShowWelcomeModal ( false )
48
58
}
49
59
0 commit comments