44 PERIODIC_NOTES_EVENT_SETTING_UPDATED ,
55 PeriodicNotesPluginAdapter ,
66} from 'obsidian-periodic-notes-provider' ;
7- import { SETTINGS_UPDATED } from './events' ;
7+ import { LOADED , SETTINGS_UPDATED } from './events' ;
88import { KanbanProvider } from './kanban/provider' ;
99import { KanbanPluginAdapter } from './plugins/kanban' ;
1010import { TasksPluginAdapter } from './plugins/tasks' ;
@@ -13,6 +13,7 @@ import { AutoTasksSettingsTab } from './settings/tab';
1313import { TasksProvider } from './tasks/provider' ;
1414import type { ObsidianApp , ObsidianVault , ObsidianWorkspace } from './types' ;
1515import { TaskFactory } from './tasks/factory' ;
16+ import debug from './log' ;
1617
1718export default class AutoTasks extends Plugin {
1819 private settings : ISettings = DEFAULT_SETTINGS ;
@@ -50,10 +51,10 @@ export default class AutoTasks extends Plugin {
5051
5152 await this . loadSettings ( ) ;
5253
53- this . app . workspace . onLayoutReady ( this . onLayoutReady . bind ( this ) ) ;
54+ this . app . workspace . onLayoutReady ( await this . onLayoutReady . bind ( this ) ) ;
5455 }
5556
56- onLayoutReady ( ) : void {
57+ async onLayoutReady ( ) : Promise < void > {
5758 if ( ! this . periodicNotesPlugin . isEnabled ( ) ) {
5859 new Notice (
5960 'The Periodic Notes plugin must be installed and available for Auto Tasks to work.' ,
@@ -62,6 +63,8 @@ export default class AutoTasks extends Plugin {
6263 return ;
6364 }
6465
66+ debug ( 'Starting initial layout and load' ) ;
67+
6568 this . settings . tasksAvailable = this . tasksPlugin . isEnabled ( ) ;
6669
6770 // Convert and setup settings from plugins
@@ -111,6 +114,9 @@ export default class AutoTasks extends Plugin {
111114
112115 // Add the settings tab
113116 this . addSettingTab ( new AutoTasksSettingsTab ( this . app , this , this . kanbanPlugin , this . kanban ) ) ;
117+
118+ this . app . workspace . trigger ( LOADED ) ;
119+ debug ( 'Initial layout and load complete' ) ;
114120 }
115121
116122 getSettings ( ) : ISettings {
0 commit comments