From 61efad4401b2e6da216b4bb9568e6e913616dadd Mon Sep 17 00:00:00 2001 From: Tobias Davis Date: Sat, 19 Aug 2023 01:01:21 -0500 Subject: [PATCH] fix: timing issue with suggestor --- main.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/main.js b/main.js index 4afe74d..236001b 100644 --- a/main.js +++ b/main.js @@ -21,10 +21,10 @@ module.exports = class AtPeople extends Plugin { this.registerEvent(this.app.vault.on('delete', async event => { await this.update(event) })) this.registerEvent(this.app.vault.on('create', async event => { await this.update(event) })) this.registerEvent(this.app.vault.on('rename', async (event, originalFilepath) => { await this.update(event, originalFilepath) })) - this.app.workspace.onLayoutReady(this.initialize) this.addSettingTab(new AtPeopleSettingTab(this.app, this)) this.suggestor = new AtPeopleSuggestor(this.app, this.settings) this.registerEditorSuggest(this.suggestor) + this.app.workspace.onLayoutReady(this.initialize) } async loadSettings() { @@ -61,7 +61,9 @@ module.exports = class AtPeople extends Plugin { const name = getPersonName(filename, this.settings) if (name) this.peopleFileMap[name] = filename } - this.updatePeopleMap() + window.setTimeout(() => { + this.updatePeopleMap() + }) } }