diff --git a/libs/msc-flash/msc-flash-harmony/src/lib/ui/restarting-device-modal/restarting-device-modal.component.tsx b/libs/msc-flash/msc-flash-harmony/src/lib/ui/restarting-device-modal/restarting-device-modal.component.tsx index 10c5e3c3f0..6ba8b4c98d 100644 --- a/libs/msc-flash/msc-flash-harmony/src/lib/ui/restarting-device-modal/restarting-device-modal.component.tsx +++ b/libs/msc-flash/msc-flash-harmony/src/lib/ui/restarting-device-modal/restarting-device-modal.component.tsx @@ -3,11 +3,15 @@ * For licensing, see https://github.com/mudita/mudita-center/blob/master/LICENSE.md */ -import { FunctionComponent } from "Core/core/types/function-component.interface" -import { intl } from "Core/__deprecated__/renderer/utils/intl" -import React from "react" +import React, { useEffect } from "react" import { defineMessages } from "react-intl" +import { useDispatch } from "react-redux" +import { intl } from "Core/__deprecated__/renderer/utils/intl" +import { Dispatch } from "Core/__deprecated__/renderer/store" +import { FunctionComponent } from "Core/core/types/function-component.interface" import LoaderModal from "Core/ui/components/loader-modal/loader-modal.component" +import { setFlashingProcessState } from "../../actions" +import { FlashingProcessState } from "../../constants" interface RestartingDeviceModalProps { open: boolean @@ -28,6 +32,16 @@ const messages = defineMessages({ export const RestartingDeviceModal: FunctionComponent< RestartingDeviceModalProps > = ({ open }) => { + const dispatch = useDispatch() + + useEffect(() => { + const timer = setTimeout(() => { + dispatch(setFlashingProcessState(FlashingProcessState.Failed)) + }, 2 * 60 * 1000) + + return () => clearTimeout(timer) + }, [dispatch]) + return (