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
19 changes: 1 addition & 18 deletions src/bases/registration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -278,24 +278,7 @@ export async function registerBasesTaskList(plugin: TaskNotesPlugin): Promise<bo
}
};

// Try immediate registration
if (await attemptRegistration()) {
return true;
}

// If that fails, try a few more times with short delays
for (let i = 0; i < 5; i++) {
await new Promise((r) => window.setTimeout(r, 200));
if (await attemptRegistration()) {
return true;
}
}

logger.warn("Failed to register views after multiple attempts", {
category: "configuration",
operation: "register-views",
});
return false;
return attemptRegistration();
}

/**
Expand Down
4 changes: 3 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,9 @@ export default class TaskNotesPlugin extends Plugin {
this.migrationPromise = this.performEarlyMigrationCheck();

initializeCalendarProviders(this);
await registerBasesIntegration(this);
// Not awaited: if Bases has not loaded yet this schedules a retry timer,
// and initializeAfterLayoutReady attempts registration again.
void registerBasesIntegration(this);

// Defer expensive initialization until layout is ready
this.app.workspace.onLayoutReady(() => {
Expand Down
Loading