Skip to content
Open
Show file tree
Hide file tree
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
11 changes: 9 additions & 2 deletions src/services/TaskCalendarSyncService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -766,6 +766,10 @@ export class TaskCalendarSyncService {
return true;
}

if (!this.plugin.settings.googleCalendarExport.enabled) {
return true;
}

if (!this.isDeletionQueueReady()) {
await this.queueCalendarDeletion(
taskPath,
Expand Down Expand Up @@ -970,7 +974,7 @@ export class TaskCalendarSyncService {

if (this.isTaskCalendarEligible(task)) {
this.profileIncrement("handleExternalTaskFileUpdated.changedEligibleTask");
if (settings.syncOnTaskCreate) {
if (settings.enabled && settings.syncOnTaskCreate) {
await this.syncTaskToCalendar(task);
} else {
await this.recordCalendarSyncFingerprint(task);
Expand Down Expand Up @@ -2430,7 +2434,10 @@ export class TaskCalendarSyncService {

try {
if (!this.isEnabled()) {
if (queueOnFailure) {
if (queueOnFailure && settings.enabled) {
// Only queue if sync is enabled but temporarily not ready
// (e.g. no calendar selected yet, or OAuth not connected).
// When enabled=false the user hasn't opted in, so don't populate the queue.
await this.queueTaskSync(
task.path,
new Error("Google Calendar sync is not ready")
Expand Down
1 change: 1 addition & 0 deletions src/services/task-service/TaskCreationService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,7 @@ export class TaskCreationService {

if (
runtime.taskCalendarSyncService &&
runtime.settings.googleCalendarExport.enabled &&
runtime.settings.googleCalendarExport.syncOnTaskCreate
) {
runtime.taskCalendarSyncService.syncTaskToCalendar(taskInfo).catch((error) => {
Expand Down