Skip to content

Commit

Permalink
fix: use name to get calendar API vs id
Browse files Browse the repository at this point in the history
  • Loading branch information
valentine195 committed Aug 25, 2023
1 parent 508fbb4 commit 9f2a3e3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ export default class Calendarium extends Plugin {
}

getAPI(calendarName: string): API {
const store = this.getStore(calendarName);
const store = this.getStore(
this.data.calendars.find((c) => c.name == calendarName).id
);
if (!store)
throw new ReferenceError("No calendar store by that name exists.");
return new API(store);
Expand Down

0 comments on commit 9f2a3e3

Please sign in to comment.