use page navigator for login push after dismissing web session dialog

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Tommy Chow 2026-03-16 23:14:27 -07:00
parent ad976b7e77
commit 17e23eba2e

View file

@ -48,9 +48,10 @@ class ProfileCard extends StatelessWidget {
), ),
title: GestureDetector( title: GestureDetector(
onTap: () { onTap: () {
final navigator = Navigator.of(context);
showDialog( showDialog(
context: context, context: context,
builder: (context) => FrostyDialog( builder: (dialogContext) => FrostyDialog(
title: 'Web session', title: 'Web session',
message: hasToken message: hasToken
? 'Your Twitch web session is linked. When using the native player, ads will be avoided on channels where you have a subscription or Twitch Turbo.' ? 'Your Twitch web session is linked. When using the native player, ads will be avoided on channels where you have a subscription or Twitch Turbo.'
@ -58,15 +59,14 @@ class ProfileCard extends StatelessWidget {
actions: [ actions: [
if (!hasToken) if (!hasToken)
TextButton( TextButton(
onPressed: Navigator.of(context).pop, onPressed: Navigator.of(dialogContext).pop,
child: const Text('Cancel'), child: const Text('Cancel'),
), ),
if (!hasToken) if (!hasToken)
FilledButton( FilledButton(
onPressed: () { onPressed: () {
Navigator.pop(context); Navigator.of(dialogContext).pop();
Navigator.push( navigator.push(
context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => LoginWebView(), builder: (context) => LoginWebView(),
), ),
@ -76,7 +76,7 @@ class ProfileCard extends StatelessWidget {
), ),
if (hasToken) if (hasToken)
TextButton( TextButton(
onPressed: Navigator.of(context).pop, onPressed: Navigator.of(dialogContext).pop,
child: const Text('OK'), child: const Text('OK'),
), ),
], ],