Skip to content

Commit

Permalink
fix: Solve freeze issue of presention request by deeplink #1727
Browse files Browse the repository at this point in the history
  • Loading branch information
bibash28 committed Jul 17, 2023
1 parent e30d42d commit 1cd3653
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ class QRCodeScanCubit extends Cubit<QRCodeScanState> {

Future<void> deepLink() async {
final deepLinkUrl = deepLinkCubit.state;
emit(state.loading(isScan: false));
if (deepLinkUrl != '') {
emit(state.loading(isScan: false));
deepLinkCubit.resetDeepLink();
try {
await verify(uri: Uri.parse(deepLinkUrl));
Expand Down
16 changes: 9 additions & 7 deletions lib/splash/bloclisteners/blocklisteners.dart
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,14 @@ final scanBlocListener = BlocListener<ScanCubit, ScanState>(
Navigator.of(context).pop();
}
}

if (state.message != null) {
AlertMessage.showStateMessage(
context: context,
stateMessage: state.message!,
);
}

if (state.status == ScanStatus.success) {
/// should pop until dashboard. Doing such we don't have to consider
/// different scanCubit scenarii (DIDAuth, scan or deeplink,
Expand All @@ -175,16 +183,10 @@ final scanBlocListener = BlocListener<ScanCubit, ScanState>(
(Route<dynamic> route) => route.isFirst,
);
}

if (state.status == ScanStatus.error) {
Navigator.of(context).pop();
}

if (state.message != null) {
AlertMessage.showStateMessage(
context: context,
stateMessage: state.message!,
);
}
},
);

Expand Down

0 comments on commit 1cd3653

Please sign in to comment.