fix: exclude managed special-dates calendars from import targets
Symmetric with the export change: the contact-derived, editor-locked special-dates mirror calendars aren't a valid import destination, so drop them from the target-calendar picker. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -84,12 +84,14 @@ class ImportViewModel @Inject constructor(
|
|||||||
else -> {
|
else -> {
|
||||||
// A disabled calendar is removed from the app, so it can't be
|
// A disabled calendar is removed from the app, so it can't be
|
||||||
// an import target — exclude it alongside the read-only ones.
|
// an import target — exclude it alongside the read-only ones.
|
||||||
|
// Managed special-dates calendars are contact-derived and
|
||||||
|
// editor-locked, so they're not a valid destination either.
|
||||||
val disabled = prefs.disabledCalendarIds.first()
|
val disabled = prefs.disabledCalendarIds.first()
|
||||||
ImportUiState.Many(
|
ImportUiState.Many(
|
||||||
events = parsed.events,
|
events = parsed.events,
|
||||||
warnings = parsed.warnings,
|
warnings = parsed.warnings,
|
||||||
calendars = repository.calendars().first()
|
calendars = repository.calendars().first()
|
||||||
.filter { it.canModifyContents && it.id !in disabled },
|
.filter { it.canModifyContents && !it.isManaged && it.id !in disabled },
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user