autoselect All if user's not logged in

This commit is contained in:
krawieck 2020-12-03 22:46:25 +01:00
parent 929d9ebbcb
commit b338a667f3
1 changed files with 11 additions and 3 deletions

View File

@ -22,10 +22,12 @@ import 'inbox.dart';
class HomeTab extends HookWidget {
@override
Widget build(BuildContext context) {
final selectedList =
useState(_SelectedList(listingType: PostListingType.subscribed));
// TODO: needs to be an observer? for accounts changes
final accStore = useAccountsStore();
final selectedList = useState(_SelectedList(
listingType: accStore.hasNoAccount
? PostListingType.all
: PostListingType.subscribed));
// TODO: needs to be an observer? for accounts changes
final isc = useInfiniteScrollController();
final theme = Theme.of(context);
final instancesIcons = useMemoFuture(() async {
@ -153,6 +155,12 @@ class HomeTab extends HookWidget {
return '$first$last';
}();
if (accStore.instances.isEmpty) {
return Scaffold(
body: Text('there needs to be at least one instance'),
);
}
return Scaffold(
// TODO: make appbar autohide when scrolling down
appBar: AppBar(