Skip to content

Commit 8b93be8

Browse files
committed
Ability to get all metadata
1 parent 1b490da commit 8b93be8

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

calendar/experiments/calendar/ext-calendar-utils.jsm

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,18 @@ function convertCalendar(extension, calendar) {
8585
// TODO find a better way to define the cache id
8686
props.cacheId = calendar.superCalendar.id + "#cache";
8787
props.capabilities = unwrapCalendar(calendar.superCalendar).capabilities; // TODO needs deep clone?
88+
if (calendar instanceof Ci.calISyncWriteCalendar) {
89+
props.metadata = {
90+
ids: calendar.getAllMetaDataIds(),
91+
values: calendar.getAllMetaDataValues().map(value => {
92+
try {
93+
return JSON.parse(value) ?? {};
94+
} catch (ex) {
95+
return {};
96+
}
97+
}),
98+
};
99+
}
88100
}
89101

90102
return props;

0 commit comments

Comments
 (0)