status-desktop/ui/app/AppLayouts/Onboarding2/pages/KeycardAddKeyPairDelayedPage.qml
Michał Cieślak d1ac45ce6c Onboarding: KeycardCreatePinPage and SeedphrasePage refactored to be pure UI components
Now those components are not aware of any logic in the upper layer,
making the flows more structured and easier to follow.

Required for: #17232
2025-02-12 13:54:46 +01:00

51 lines
1.2 KiB
QML

import QtQuick 2.15
import QtQuick.Layouts 1.15
import AppLayouts.Onboarding.enums 1.0
/*!
\qmltype KeycardAddKeyPairDelayedPage
\inherits KeycardAddKeyPairPage
\brief It wraps KeycardAddKeyPairPaget and controls it using addKeyPairState
property and adding minimal times of displaying particular states.
*/
KeycardAddKeyPairPage {
id: root
required property int addKeyPairState
inProgress: d.addKeyPairState !== Onboarding.ProgressState.Success
signal finished
QtObject {
id: d
property int addKeyPairState: root.addKeyPairState
readonly property int inProgressMinimalTime: 2000
readonly property int successMinimalTime: 2000
Binding on addKeyPairState {
when: extendingInProgressStateTimer.running
value: Onboarding.ProgressState.InProgress
}
}
Timer {
id: extendingInProgressStateTimer
interval: d.inProgressMinimalTime
running: true
}
Timer {
id: extendingSuccessStateTimer
running: root.addKeyPairState === Onboarding.ProgressState.Success
interval: d.successMinimalTime
onTriggered: root.finished()
}
}