Skip to content

Commit

Permalink
make variable name more specific
Browse files Browse the repository at this point in the history
  • Loading branch information
davish committed Sep 6, 2023
1 parent fd8417b commit faecf2f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions src/ui/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export interface FullCalendarSettings {
mobile: string;
};
timeFormat24h: boolean;
clickToCreateEvent: boolean;
clickToCreateEventFromMonthView: boolean;
}

export const DEFAULT_SETTINGS: FullCalendarSettings = {
Expand All @@ -38,7 +38,7 @@ export const DEFAULT_SETTINGS: FullCalendarSettings = {
mobile: "timeGrid3Days",
},
timeFormat24h: false,
clickToCreateEvent: true,
clickToCreateEventFromMonthView: true,
};

const WEEKDAYS = [
Expand Down Expand Up @@ -237,9 +237,11 @@ export class FullCalendarSettingTab extends PluginSettingTab {
.setName("Click on a day in month view to create event")
.setDesc("Switch off to open day view on click instead.")
.addToggle((toggle) => {
toggle.setValue(this.plugin.settings.clickToCreateEvent);
toggle.setValue(
this.plugin.settings.clickToCreateEventFromMonthView
);
toggle.onChange(async (val) => {
this.plugin.settings.clickToCreateEvent = val;
this.plugin.settings.clickToCreateEventFromMonthView = val;
await this.plugin.saveSettings();
});
});
Expand Down
2 changes: 1 addition & 1 deletion src/ui/view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ export class CalendarView extends ItemView {
);
try {
if (
this.plugin.settings.clickToCreateEvent ||
this.plugin.settings.clickToCreateEventFromMonthView ||
viewType !== "dayGridMonth"
) {
launchCreateModal(this.plugin, partialEvent);
Expand Down

0 comments on commit faecf2f

Please sign in to comment.