format: paket.ready

This commit is contained in:
jane400 2024-09-17 20:12:25 +02:00 committed by jane400
parent 02b129fb84
commit b6160ab1a8

View file

@ -1,21 +1,10 @@
// managed the various pages...
use std::hash::DefaultHasher;
use std::string;
use std::time::Duration;
use adw::prelude::*;
use libpaket::{
self,
advices::{AdvicesList, UatToken},
tracking::{Shipment, TrackingParams},
LibraryError, LibraryResult,
};
use relm4::{
adw,
factory::{FactoryHashMap, FactorySender, FactoryVecDeque},
prelude::*,
};
use relm4::{adw, factory::FactoryHashMap, prelude::*};
use crate::advices::{AdvicesView, AdvicesViewInput};
@ -275,12 +264,10 @@ impl Component for Ready {
libpaket::stammdaten::CustomerDataService::Paketankuendigung => {
sender.input(ReadyInput::HaveService(Services::SendungVerfolgung))
}
libpaket::stammdaten::CustomerDataService::PostfilialeDirekt => (),
libpaket::stammdaten::CustomerDataService::Digiben => (),
libpaket::stammdaten::CustomerDataService::GeraetAktiviert => (),
libpaket::stammdaten::CustomerDataService::Briefankuendigung => {
sender.input(ReadyInput::HaveService(Services::Advices))
}
_ => (),
}
}
@ -345,7 +332,12 @@ impl Component for Ready {
if err == LibraryError::APIChange {
println!("Upstream API for parcel tracking broke");
sender.input(ReadyInput::ServiceBorked(Services::SendungVerfolgung));
sender.output(ReadyOutput::Notification("Shipment Tracking API has changed. Deactivating that service.".to_string())).unwrap();
sender
.output(ReadyOutput::Notification(
"Shipment Tracking API has changed. Deactivating that service."
.to_string(),
))
.unwrap();
} else {
sender.output(ReadyOutput::Error(err)).unwrap();
}