Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
nilsreichardt committed Oct 16, 2024
1 parent 21c1621 commit 59d0731
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/lib/dashboard/dashboard_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,17 @@ class _AdsInfoDialogListener extends StatefulWidget {
}

class _AdsInfoDialogListenerState extends State<_AdsInfoDialogListener> {
// The AdsController already has a flag for this, but just to be safe for race
// conditions, we also keep track of it here.
bool hasShownDialog = false;

@override
Widget build(BuildContext context) {
final showDialog = context.watch<AdsController>().shouldShowInfoDialog;
if (showDialog && !hasShownDialog) {
hasShownDialog = true;
context.read<AdsController>().shouldShowInfoDialog = false;

WidgetsBinding.instance.addPostFrameCallback((_) {
showAdInfoDialog(context);
});
Expand Down

0 comments on commit 59d0731

Please sign in to comment.