mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-21 09:03:02 +00:00
Resolve "Error: Database not created"
This commit is contained in:
@@ -33,7 +33,8 @@ import {
|
||||
CALENDAR_NOTIFICATIONS_ENABLED_KEY,
|
||||
CALENDAR_SYNC_ENABLED_KEY,
|
||||
CALENDAR_SYNC_KEYS,
|
||||
CALENDAR_SYNC_SETTINGS_KEY,
|
||||
calendarSettingStorageKey,
|
||||
getCalendarSetting,
|
||||
} from './calendar-sync-settings-keys';
|
||||
|
||||
@Component({
|
||||
@@ -71,10 +72,11 @@ export class CalendarSyncSettingsComponent implements OnInit {
|
||||
);
|
||||
}
|
||||
|
||||
async getSetting(key: CALENDAR_SYNC_KEYS) {
|
||||
return (await this.storageProvider.get(
|
||||
`${CALENDAR_SYNC_SETTINGS_KEY}.${key}`,
|
||||
)) as boolean;
|
||||
async getSetting(
|
||||
key: CALENDAR_SYNC_KEYS,
|
||||
defaultValue = false,
|
||||
): Promise<boolean> {
|
||||
return getCalendarSetting(this.storageProvider, key, defaultValue);
|
||||
}
|
||||
|
||||
async syncCalendar(sync: boolean) {
|
||||
@@ -98,10 +100,7 @@ export class CalendarSyncSettingsComponent implements OnInit {
|
||||
async setSetting(settings: Partial<Record<CALENDAR_SYNC_KEYS, boolean>>) {
|
||||
await Promise.all(
|
||||
map(settings, (setting, key) =>
|
||||
this.storageProvider.put(
|
||||
`${CALENDAR_SYNC_SETTINGS_KEY}.${key}`,
|
||||
setting,
|
||||
),
|
||||
this.storageProvider.put(calendarSettingStorageKey(key), setting),
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user