fix: Click on room aliases

This commit is contained in:
Christian Pauly 2021-05-24 11:07:02 +02:00
parent b0ccf845b8
commit c5620c4f69
2 changed files with 11 additions and 3 deletions

View File

@ -131,11 +131,18 @@ class SearchController extends State<Search> {
setState(() {});
}
bool _init = false;
@override
Widget build(BuildContext context) {
alias = VRouter.of(context).queryParameters['query'];
if (alias != null) genericSearchTerm ??= alias;
if (!_init) {
_init = true;
controller.text = VRouter.of(context).queryParameters['query'] ?? '';
WidgetsBinding.instance
.addPostFrameCallback((_) => search(controller.text));
}
return SearchView(this);
}
}
// #fluffychat:matrix.org

View File

@ -62,7 +62,8 @@ class SearchView extends StatelessWidget {
);
return DefaultTabController(
length: 3,
initialIndex: 1,
initialIndex:
controller.controller.text?.startsWith('#') ?? false ? 0 : 1,
child: Scaffold(
appBar: AppBar(
leading: BackButton(),