fix: timing issue with suggestor

This commit is contained in:
Tobias Davis 2023-08-19 01:01:21 -05:00
parent ebc86de6ef
commit 61efad4401

View file

@ -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()
})
}
}