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(app): update ODD unfinished route path when update not necessary #12975

Merged
merged 1 commit into from
Jun 29, 2023
Merged
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
13 changes: 12 additions & 1 deletion app/src/organisms/UpdateRobotSoftware/NoUpdateFound.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as React from 'react'
import { useTranslation } from 'react-i18next'
import { useDispatch } from 'react-redux'
import { useHistory } from 'react-router-dom'

import {
Expand All @@ -16,10 +17,12 @@ import {

import { StyledText } from '../../atoms/text'
import { MediumButton } from '../../atoms/buttons'
import { updateConfigValue } from '../../redux/config'

export function NoUpdateFound(): JSX.Element {
const { i18n, t } = useTranslation(['device_settings', 'shared'])
const history = useHistory()
const dispatch = useDispatch()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import type { Dispatch } from '../../redux/types'
Suggested change
const dispatch = useDispatch()
const dispatch = useDispatch<Dispatch>()

return (
<Flex
flexDirection={DIRECTION_COLUMN}
Expand Down Expand Up @@ -48,7 +51,15 @@ export function NoUpdateFound(): JSX.Element {
</Flex>
<MediumButton
buttonText={i18n.format(t('shared:continue'), 'capitalize')}
onClick={() => history.push('/robot-settings/rename-robot')}
onClick={() => {
dispatch(
updateConfigValue(
'onDeviceDisplaySettings.unfinishedUnboxingFlowRoute',
'/robot-settings/rename-robot'
)
)
history.push('/robot-settings/rename-robot')
}}
/>
</Flex>
)
Expand Down