Skip to content
Snippets Groups Projects
Commit d2caeefb authored by Leon Tappe's avatar Leon Tappe :fire:
Browse files

fix state at startup to prevent loading qr scanner

parent 2cc5b544
No related branches found
No related tags found
No related merge requests found
......@@ -21,7 +21,7 @@ class VerificationBloc extends Bloc<VerificationEvent, VerificationState> {
VerificationApi? _api;
VerificationResponse? _verification;
VerificationBloc(String url) : super(VerificationState.noTicket) {
VerificationBloc(String url) : super(VerificationState.busy) {
_api = VerificationApi(http.Client(), url);
_initTicketFile().then((value) => _loadTicket());
}
......@@ -92,6 +92,7 @@ class VerificationBloc extends Bloc<VerificationEvent, VerificationState> {
} else {
_log.fine('no ticket found, creating ticket store');
_ticketStore!.create(recursive: true);
emit(VerificationState.noTicket);
}
}
}
......@@ -108,6 +109,11 @@ class VerificationEvent {
factory VerificationEvent.check() => VerificationEvent(type: EventType.check);
factory VerificationEvent.revoke() => VerificationEvent(type: EventType.revoke);
Map get toMap => {'type': type, 'ticket': ticket};
@override
String toString() => '[VerificationEvent $toMap]';
}
enum VerificationState {
......@@ -115,4 +121,5 @@ enum VerificationState {
verified,
unverified,
error,
busy,
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment