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

[CP-3135] Infinite loop after flashing - MC not aware that flashed device is actually ready to use #2123

Merged
merged 1 commit into from
Oct 14, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -28,6 +32,16 @@ const messages = defineMessages({
export const RestartingDeviceModal: FunctionComponent<
RestartingDeviceModalProps
> = ({ open }) => {
const dispatch = useDispatch<Dispatch>()

useEffect(() => {
const timer = setTimeout(() => {
dispatch(setFlashingProcessState(FlashingProcessState.Failed))
}, 2 * 60 * 1000)

return () => clearTimeout(timer)
}, [dispatch])

return (
<LoaderModal
open={open}
Expand Down
Loading