Don't break app by subscribed calendars
Signed-off-by: Raimund Schlüßler <raimund.schluessler@mailbox.org>
This commit is contained in:
parent
c91f52d428
commit
e70a8423fa
1 changed files with 13 additions and 1 deletions
|
@ -88,6 +88,18 @@ export function mapDavCollectionToCalendar(calendar, currentUserPrincipal) {
|
||||||
// As fallback if we don't know what color that is supposed to be
|
// As fallback if we don't know what color that is supposed to be
|
||||||
color = uidToHexColor(displayName)
|
color = uidToHexColor(displayName)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const shares = []
|
||||||
|
if (!!currentUserPrincipal && Array.isArray(calendar.shares)) {
|
||||||
|
for (const share of calendar.shares) {
|
||||||
|
if (share.href === currentUserPrincipal.principalScheme) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
shares.push(mapDavShareeToSharee(share))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
// get last part of url
|
// get last part of url
|
||||||
id: calendar.url.split('/').slice(-2, -1)[0],
|
id: calendar.url.split('/').slice(-2, -1)[0],
|
||||||
|
@ -99,7 +111,7 @@ export function mapDavCollectionToCalendar(calendar, currentUserPrincipal) {
|
||||||
tasks: {},
|
tasks: {},
|
||||||
url: calendar.url,
|
url: calendar.url,
|
||||||
dav: calendar,
|
dav: calendar,
|
||||||
shares: calendar.shares.map(sharee => Object.assign({}, mapDavShareeToSharee(sharee))),
|
shares,
|
||||||
supportsTasks: calendar.components.includes('VTODO'),
|
supportsTasks: calendar.components.includes('VTODO'),
|
||||||
loadedCompleted: false,
|
loadedCompleted: false,
|
||||||
isSharedWithMe,
|
isSharedWithMe,
|
||||||
|
|
Loading…
Reference in a new issue