|
|
|
|
@ -38,23 +38,23 @@ class _ChatHomeState extends State<ChatHome> {
|
|
|
|
|
data.clearAll();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void fetchAgain() {
|
|
|
|
|
print("Fetch Triggered");
|
|
|
|
|
if (chatHubConnection.state != HubConnectionState.Connected) {
|
|
|
|
|
data.getUserAutoLoginToken().whenComplete(() async {
|
|
|
|
|
await data.buildHubConnection();
|
|
|
|
|
data.getUserRecentChats();
|
|
|
|
|
});
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (data.searchedChats == null || data.searchedChats!.isEmpty) {
|
|
|
|
|
data.getUserRecentChats();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// void fetchAgain() {
|
|
|
|
|
// print("Fetch Triggered");
|
|
|
|
|
// if (chatHubConnection.state != HubConnectionState.Connected) {
|
|
|
|
|
// data.getUserAutoLoginToken().whenComplete(() async {
|
|
|
|
|
// await data.buildHubConnection();
|
|
|
|
|
// data.getUserRecentChats();
|
|
|
|
|
// });
|
|
|
|
|
// return;
|
|
|
|
|
// }
|
|
|
|
|
// if (data.searchedChats == null || data.searchedChats!.isEmpty) {
|
|
|
|
|
// data.getUserRecentChats();
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
fetchAgain();
|
|
|
|
|
// fetchAgain();
|
|
|
|
|
return Scaffold(
|
|
|
|
|
backgroundColor: MyColors.white,
|
|
|
|
|
appBar: AppBarWidget(context, title: LocaleKeys.chat.tr(), showHomeButton: true),
|
|
|
|
|
|