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: skipping confirmation in device update in bootloader #191

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { useAppSelector, selectLanguage } from '~/store';
import { getCloseAppMethod } from '~/utils';

import { DeviceUpdateLoading } from './DeviceUpdateLoading';
import { DeviceHandlingState, useDevice } from '~/context';

export const DeviceUpdateDialogBox: FC = () => {
const lang = useAppSelector(selectLanguage);
Expand All @@ -26,6 +27,8 @@ export const DeviceUpdateDialogBox: FC = () => {
const { state, downloadProgress, version, errorToShow, onRetry } =
useDeviceUpdate();

const { deviceHandlingState } = useDevice();

useEffect(() => {
if (state === DeviceUpdateState.NotRequired) {
toNextPage();
Expand All @@ -39,16 +42,32 @@ export const DeviceUpdateDialogBox: FC = () => {
text={lang.strings.onboarding.deviceUpdate.dialogs.checking.title}
/>
),
[DeviceUpdateState.Confirmation]: (
<ConfirmationDialog
title={
lang.strings.onboarding.deviceUpdate.dialogs.confirmation.title
}
icon={<DeviceUpdateIcon />}
[DeviceUpdateState.Confirmation]:
deviceHandlingState === DeviceHandlingState.BOOTLOADER ? (
<ConfirmationDialog
title={
lang.strings.onboarding.deviceUpdate.dialogs.confirmation.title
}
icon={<DeviceUpdateIcon />}
subtext={
lang.strings.onboarding.deviceUpdate.dialogs.confirmation.subtext
}
textVariables={{ version }}
/>
) : (
<DeviceUpdateLoading
text={lang.strings.onboarding.deviceUpdate.dialogs.checking.title}
/>
),
[DeviceUpdateState.Updating]: (
<ProgressDialog
title={lang.strings.onboarding.deviceUpdate.dialogs.updating.heading}
subtext={
lang.strings.onboarding.deviceUpdate.dialogs.confirmation.subtext
lang.strings.onboarding.deviceUpdate.dialogs.updating.subtext
}
textVariables={{ version }}
icon={<DeviceUpdateIcon />}
progress={Number(downloadProgress.toFixed(0))}
versionTextVariables={{ version }}
/>
),
[DeviceUpdateState.Updating]: (
Expand Down