Skip to content

Commit c1af404

Browse files
committed
Remove bogus Waiting hybrid state
1 parent c5deb31 commit c1af404

3 files changed

Lines changed: 4 additions & 22 deletions

File tree

xyz-iinuwa-credential-manager-portal-gtk/src/credential_service/hybrid.rs

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,10 @@ impl HybridHandler for InternalHybridHandler {
104104

105105
#[derive(Clone, Debug)]
106106
pub(super) enum HybridStateInternal {
107-
/// The FIDO string to be displayed to the user, which contains QR secret
108-
/// and public key.
107+
/// Awaiting BLE advert from phone. Content is the FIDO string to be
108+
/// displayed to the user, which contains QR secret and public key.
109109
Init(String),
110110

111-
/// Awaiting BLE advert from phone.
112-
Waiting,
113-
114111
/// BLE advertisement has been received from phone, tunnel is being established
115112
Connecting,
116113

@@ -129,12 +126,10 @@ pub struct HybridEvent {
129126

130127
#[derive(Clone, Debug)]
131128
pub enum HybridState {
132-
/// The FIDO string to be displayed to the user, which contains QR secret
129+
/// Awaiting BLE advert from phone. Content is the FIDO string to be displayed to the user, which contains QR secret
133130
/// and public key.
134131
Init(String),
135132

136-
/// Awaiting BLE advert from phone.
137-
Waiting,
138133
/// BLE advertisement has been received from phone, tunnel is being established
139134
Connecting,
140135

@@ -149,7 +144,6 @@ impl From<HybridStateInternal> for HybridState {
149144
fn from(value: HybridStateInternal) -> Self {
150145
match value {
151146
HybridStateInternal::Init(qr_code) => HybridState::Init(qr_code),
152-
HybridStateInternal::Waiting => HybridState::Waiting,
153147
HybridStateInternal::Connecting => HybridState::Connecting,
154148
HybridStateInternal::Completed(_) => HybridState::Completed,
155149
HybridStateInternal::UserCancelled => HybridState::UserCancelled,
@@ -246,7 +240,6 @@ pub(super) mod test {
246240
DummyHybridStateStream {
247241
states: vec![
248242
HybridStateInternal::Init(qr_code),
249-
HybridStateInternal::Waiting,
250243
HybridStateInternal::Connecting,
251244
HybridStateInternal::Completed(response.into()),
252245
],

xyz-iinuwa-credential-manager-portal-gtk/src/credential_service/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,6 @@ mod test {
242242

243243
let hybrid_handler = DummyHybridHandler::new(vec![
244244
HybridStateInternal::Init(qr_code),
245-
HybridStateInternal::Waiting,
246245
HybridStateInternal::Connecting,
247246
HybridStateInternal::Completed(authenticator_response),
248247
]);

xyz-iinuwa-credential-manager-portal-gtk/src/view_model/mod.rs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -217,11 +217,6 @@ impl<C: CredentialServiceClient + Send> ViewModel<C> {
217217
.await
218218
.unwrap();
219219
}
220-
HybridState::Waiting => {
221-
tx.send(BackgroundEvent::HybridQrStateChanged(state))
222-
.await
223-
.unwrap();
224-
}
225220
HybridState::Connecting => {
226221
tx.send(BackgroundEvent::HybridQrStateChanged(state))
227222
.await
@@ -343,7 +338,6 @@ impl<C: CredentialServiceClient + Send> ViewModel<C> {
343338
.await
344339
.unwrap();
345340
}
346-
HybridState::Waiting => {}
347341
HybridState::Connecting => {
348342
self.hybrid_qr_code_data = None;
349343
self.tx_update
@@ -431,12 +425,9 @@ pub enum HybridState {
431425
#[default]
432426
Idle,
433427

434-
/// QR code flow is starting
428+
/// QR code flow is starting, awaiting QR code scan and BLE advert from phone.
435429
Started(String),
436430

437-
/// QR code is being displayed, awaiting QR code scan and BLE advert from phone.
438-
Waiting,
439-
440431
/// BLE advert received, connecting to caBLE tunnel with shared secret.
441432
Connecting,
442433

@@ -457,7 +448,6 @@ impl From<crate::credential_service::hybrid::HybridState> for HybridState {
457448
crate::credential_service::hybrid::HybridState::Init(qr_code) => {
458449
HybridState::Started(qr_code)
459450
}
460-
crate::credential_service::hybrid::HybridState::Waiting => HybridState::Waiting,
461451
crate::credential_service::hybrid::HybridState::Connecting => HybridState::Connecting,
462452
crate::credential_service::hybrid::HybridState::Completed => HybridState::Completed,
463453
crate::credential_service::hybrid::HybridState::UserCancelled => {

0 commit comments

Comments
 (0)