From f983b056a578f94e08522ffb9f767c887fe80f7f Mon Sep 17 00:00:00 2001 From: Vishnu Mohandas Date: Tue, 26 Jan 2021 17:18:17 +0530 Subject: [PATCH] Fix redirection logic after password reentry --- lib/ui/password_reentry_page.dart | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/ui/password_reentry_page.dart b/lib/ui/password_reentry_page.dart index 976e1a79a..cf7ee3d86 100644 --- a/lib/ui/password_reentry_page.dart +++ b/lib/ui/password_reentry_page.dart @@ -1,8 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; +import 'package:logging/logging.dart'; import 'package:photos/core/configuration.dart'; -import 'package:photos/core/event_bus.dart'; -import 'package:photos/events/user_authenticated_event.dart'; import 'package:photos/services/billing_service.dart'; import 'package:photos/ui/common_elements.dart'; import 'package:photos/ui/subscription_page.dart'; @@ -81,13 +80,15 @@ class _PasswordReentryPageState extends State { _passwordController.text, Configuration.instance.getKeyAttributes()); } catch (e) { + Logger("PRP").warning(e); await dialog.hide(); showErrorDialog(context, "incorrect password", "please try again"); return; } await dialog.hide(); - if (BillingService.instance.hasActiveSubscription()) { + if (!BillingService.instance + .hasActiveSubscription()) { Navigator.of(context).push( MaterialPageRoute( builder: (BuildContext context) { @@ -95,9 +96,10 @@ class _PasswordReentryPageState extends State { }, ), ); + } else { + Navigator.of(context) + .popUntil((route) => route.isFirst); } - Navigator.of(context) - .popUntil((route) => route.isFirst); } : null, )),