mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-12-18 02:42:34 +01:00
fix: Wait for first sync on bootstrap
This commit is contained in:
parent
a6ab9a2ab0
commit
d6728783a2
@ -156,9 +156,14 @@ class ChatListController extends State<ChatList> {
|
||||
@override
|
||||
void initState() {
|
||||
_initReceiveSharingIntent();
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
||||
WidgetsBinding.instance.addPostFrameCallback(
|
||||
(_) => waitForFirstSync().then((_) => checkBootstrap()),
|
||||
);
|
||||
super.initState();
|
||||
}
|
||||
|
||||
void checkBootstrap() async {
|
||||
if (!Matrix.of(context).client.encryptionEnabled) return;
|
||||
await waitForFirstSync();
|
||||
if ((Matrix.of(context).client.database as FlutterMatrixHiveStore)
|
||||
.get(SettingKeys.dontAskForBootstrapKey) ==
|
||||
true) {
|
||||
@ -166,16 +171,12 @@ class ChatListController extends State<ChatList> {
|
||||
}
|
||||
final crossSigning = await crossSigningCachedFuture;
|
||||
final needsBootstrap =
|
||||
Matrix.of(context).client.encryption?.crossSigning?.enabled ==
|
||||
false ||
|
||||
Matrix.of(context).client.encryption?.crossSigning?.enabled == false ||
|
||||
crossSigning == false;
|
||||
final isUnknownSession = Matrix.of(context).client.isUnknownSession;
|
||||
if (needsBootstrap || isUnknownSession) {
|
||||
firstRunBootstrapAction();
|
||||
}
|
||||
});
|
||||
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
|
Loading…
Reference in New Issue
Block a user