Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion src/store/calendars.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,18 @@ export function mapDavCollectionToCalendar(calendar, currentUserPrincipal) {
// As fallback if we don't know what color that is supposed to be
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 {
// get last part of url
id: calendar.url.split('/').slice(-2, -1)[0],
Expand All @@ -99,7 +111,7 @@ export function mapDavCollectionToCalendar(calendar, currentUserPrincipal) {
tasks: {},
url: calendar.url,
dav: calendar,
shares: calendar.shares.map(sharee => Object.assign({}, mapDavShareeToSharee(sharee))),
shares,
supportsTasks: calendar.components.includes('VTODO'),
loadedCompleted: false,
isSharedWithMe,
Expand Down