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 adw::prelude::*;
use libpaket::{ use libpaket::{
self, self,
advices::{AdvicesList, UatToken},
tracking::{Shipment, TrackingParams}, tracking::{Shipment, TrackingParams},
LibraryError, LibraryResult, LibraryError, LibraryResult,
}; };
use relm4::{ use relm4::{adw, factory::FactoryHashMap, prelude::*};
adw,
factory::{FactoryHashMap, FactorySender, FactoryVecDeque},
prelude::*,
};
use crate::advices::{AdvicesView, AdvicesViewInput}; use crate::advices::{AdvicesView, AdvicesViewInput};
@ -275,12 +264,10 @@ impl Component for Ready {
libpaket::stammdaten::CustomerDataService::Paketankuendigung => { libpaket::stammdaten::CustomerDataService::Paketankuendigung => {
sender.input(ReadyInput::HaveService(Services::SendungVerfolgung)) sender.input(ReadyInput::HaveService(Services::SendungVerfolgung))
} }
libpaket::stammdaten::CustomerDataService::PostfilialeDirekt => (),
libpaket::stammdaten::CustomerDataService::Digiben => (),
libpaket::stammdaten::CustomerDataService::GeraetAktiviert => (),
libpaket::stammdaten::CustomerDataService::Briefankuendigung => { libpaket::stammdaten::CustomerDataService::Briefankuendigung => {
sender.input(ReadyInput::HaveService(Services::Advices)) sender.input(ReadyInput::HaveService(Services::Advices))
} }
_ => (),
} }
} }
@ -345,7 +332,12 @@ impl Component for Ready {
if err == LibraryError::APIChange { if err == LibraryError::APIChange {
println!("Upstream API for parcel tracking broke"); println!("Upstream API for parcel tracking broke");
sender.input(ReadyInput::ServiceBorked(Services::SendungVerfolgung)); 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 { } else {
sender.output(ReadyOutput::Error(err)).unwrap(); sender.output(ReadyOutput::Error(err)).unwrap();
} }