Resolve "Error: Database not created"

This commit is contained in:
Thea Schöbl
2022-02-23 14:58:33 +00:00
parent 75f4644940
commit aabb29ad05
5 changed files with 50 additions and 27 deletions

View File

@@ -18,10 +18,10 @@ import {App, URLOpenListenerEvent} from '@capacitor/app';
import {Platform, ToastController} from '@ionic/angular';
import {SettingsProvider} from './modules/settings/settings.provider';
import {AuthHelperService} from './modules/auth/auth-helper.service';
import {ScheduleSyncService} from './modules/background/schedule/schedule-sync.service';
import {environment} from '../environments/environment';
import {StatusBar, Style} from '@capacitor/status-bar';
import {Capacitor} from '@capacitor/core';
import {ScheduleSyncService} from './modules/background/schedule/schedule-sync.service';
/**
* TODO
@@ -53,7 +53,6 @@ export class AppComponent implements AfterContentInit {
* @param zone The angular zone
* @param authHelper Helper service for OAuth providers
* @param toastController Toast controller
* @param scheduleSync TODO
*/
constructor(
private readonly platform: Platform,
@@ -62,13 +61,14 @@ export class AppComponent implements AfterContentInit {
private readonly zone: NgZone,
private readonly authHelper: AuthHelperService,
private readonly toastController: ToastController,
private readonly scheduleSync: ScheduleSyncService,
private readonly scheduleSyncService: ScheduleSyncService,
) {
void this.initializeApp();
}
ngAfterContentInit() {
void this.scheduleSync.enable();
ngAfterContentInit(): void {
this.scheduleSyncService.init();
void this.scheduleSyncService.enable();
}
/**
@@ -86,10 +86,10 @@ export class AppComponent implements AfterContentInit {
});
});
this.platform.ready().then(async () => {
await this.authInit();
if (Capacitor.isNativePlatform()) {
await StatusBar.setStyle({style: Style.Dark});
}
await this.authInit();
// set order of categories in settings
this.settingsProvider.setCategoriesOrder([