Skip to content

Commit

Permalink
Fix account page infinite loading (#1388)
Browse files Browse the repository at this point in the history
potentially fix issue where account page loads infinitely
  • Loading branch information
hjiangsu authored May 28, 2024
1 parent 6fee468 commit 9e93f21
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions lib/account/pages/account_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,18 @@ class _AccountPageState extends State<AccountPage> with AutomaticKeepAliveClient
},
),
],
child: (authState.isLoggedIn)
? UserPage(
userId: accountState.personView?.person.id,
isAccountUser: true,
selectedUserOption: selectedUserOption,
savedToggle: savedToggle,
)
: const AccountPlaceholder(),
child: BlocBuilder<AccountBloc, AccountState>(
builder: (context, state) {
if (authState.isLoggedIn != true) return const AccountPlaceholder();

return UserPage(
userId: accountState.personView?.person.id,
isAccountUser: true,
selectedUserOption: selectedUserOption,
savedToggle: savedToggle,
);
},
),
);
}

Expand Down

0 comments on commit 9e93f21

Please sign in to comment.