Move less important syncs to own function

This commit is contained in:
Kelrap 2024-07-30 14:26:26 -04:00
parent 347fa01ff8
commit 097417188d

View file

@ -933,8 +933,17 @@ class ChatListController extends State<ChatList>
}
// #Pangea
_lessImportantSyncs(client);
// Pangea#
if (!mounted) return;
setState(() {
waitForFirstSync = true;
});
}
// #Pangea
Future<void> _lessImportantSyncs(Client client) async {
if (mounted) {
// TODO try not to await so much
GoogleAnalytics.analyticsUserUpdate(client.userID);
await pangeaController.subscriptionController.initialize();
await pangeaController.myAnalytics.initialize();
@ -946,14 +955,9 @@ class ChatListController extends State<ChatList>
ErrorHandler.logError(
m: "didn't run afterSyncAndFirstLoginInitialization because not mounted",
);
// debugger(when: kDebugMode);
}
// Pangea#
if (!mounted) return;
setState(() {
waitForFirstSync = true;
});
}
// Pangea#
void cancelAction() {
if (selectMode == SelectMode.share) {