Function getBackupScheduleConfig

  • Retrieves backup schedule configuration, using defaults if not found.

    Returns BackupScheduleConfig

    The saved backup schedule configuration or default.

    export function getBackupScheduleConfig(): BackupScheduleConfig {
    try {
    const config = storage.getItem(STORAGE_KEYS.BACKUP_SCHEDULE_CONFIG);
    return config
    ? { ...DEFAULT_BACKUP_SCHEDULE_CONFIG, ...JSON.parse(config) }
    : DEFAULT_BACKUP_SCHEDULE_CONFIG;
    } catch (error) {
    console.error(
    "[Storage] Error retrieving backup schedule config from storage",
    error,
    );
    return DEFAULT_BACKUP_SCHEDULE_CONFIG;
    }
    }