fix: More debug logs

This commit is contained in:
Christian Pauly 2020-10-04 12:32:29 +02:00 committed by Inex Code
parent daa329b183
commit a9678918a3
2 changed files with 6 additions and 1 deletions

View File

@ -85,7 +85,9 @@ class MatrixState extends State<Matrix> {
void _initWithStore() async {
var initLoginState = client.onLoginStateChanged.stream.first;
try {
client.database = await getDatabase(client);
client.database = await getDatabase(client).timeout(
Duration(seconds: 15),
);
client.connect();
if (await initLoginState == LoginState.logged && PlatformInfos.isMobile) {
await FirebaseController.setupFirebase(
@ -97,6 +99,7 @@ class MatrixState extends State<Matrix> {
} catch (e, s) {
client.onLoginStateChanged.sink.addError(e, s);
captureException(e, s);
rethrow;
}
}

View File

@ -31,7 +31,9 @@ Future<Database> getDatabase(Client client) async {
filename: 'moor.sqlite',
password: password,
);
debugPrint('[Moor] Database has been created');
if (needMigration) {
debugPrint('[Moor] Start migration');
await migrate(client.clientName, _db, store);
await store.setItem('database-password', password);
}