mirror of
https://github.com/block/buzz.git
synced 2026-10-27 20:41:57 +00:00
fix(mobile): keep sign-in recovery on the current screen
Co-authored-by: Brain <1a02c72794dcd0f07058a353bc3a81f4028b8c77c92c87fce6d5c8b85970a20b@buzz.block.builderlab.xyz> Signed-off-by: Wes <wesbillman@users.noreply.github.com>
This commit is contained in:
@@ -7,6 +7,7 @@ import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'features/channels/deep_link_dispatcher.dart';
|
||||
import 'features/onboarding/hosted_connect_page.dart';
|
||||
import 'shared/auth/auth.dart';
|
||||
import 'shared/theme/grid.dart';
|
||||
import 'shared/deeplink/deep_link.dart';
|
||||
import 'shared/hosted/account_identity_store.dart';
|
||||
import 'shared/hosted/browser_auth.dart';
|
||||
@@ -184,6 +185,30 @@ class HostedAppGate extends HookConsumerWidget {
|
||||
fit: StackFit.expand,
|
||||
children: [
|
||||
child,
|
||||
if (flow.stage == HostedFlowStage.signIn)
|
||||
Positioned(
|
||||
left: Grid.sm,
|
||||
right: Grid.sm,
|
||||
bottom: 0,
|
||||
child: SafeArea(
|
||||
child: Material(
|
||||
color: Colors.transparent,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
TextButton(
|
||||
onPressed: flow.retry,
|
||||
child: const Text('Start login again'),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: flow.leave,
|
||||
child: const Text('Leave setup'),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
if (visible &&
|
||||
!openingSignIn &&
|
||||
(!inlineEntry ||
|
||||
|
||||
@@ -50,8 +50,11 @@ void main() {
|
||||
expect(find.byType(HostedConnectPage), findsNothing);
|
||||
expect(find.text('Signing in…').hitTestable(), findsOneWidget);
|
||||
expect(find.text('Enter a community link'), findsOneWidget);
|
||||
await f.flow.leave();
|
||||
expect(find.text('Start login again').hitTestable(), findsOneWidget);
|
||||
f.expired = false;
|
||||
await tester.tap(find.text('Leave setup').hitTestable());
|
||||
await tester.pumpAndSettle();
|
||||
expect(f.flow.stage, HostedFlowStage.idle);
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.text('Continue with Builderlab'), findsOneWidget);
|
||||
expect(find.byType(HostedConnectPage), findsNothing);
|
||||
|
||||
Reference in New Issue
Block a user