Skip to content

Commit 61efad4

Browse files
committed
fix: timing issue with suggestor
1 parent ebc86de commit 61efad4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

main.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ module.exports = class AtPeople extends Plugin {
2121
this.registerEvent(this.app.vault.on('delete', async event => { await this.update(event) }))
2222
this.registerEvent(this.app.vault.on('create', async event => { await this.update(event) }))
2323
this.registerEvent(this.app.vault.on('rename', async (event, originalFilepath) => { await this.update(event, originalFilepath) }))
24-
this.app.workspace.onLayoutReady(this.initialize)
2524
this.addSettingTab(new AtPeopleSettingTab(this.app, this))
2625
this.suggestor = new AtPeopleSuggestor(this.app, this.settings)
2726
this.registerEditorSuggest(this.suggestor)
27+
this.app.workspace.onLayoutReady(this.initialize)
2828
}
2929

3030
async loadSettings() {
@@ -61,7 +61,9 @@ module.exports = class AtPeople extends Plugin {
6161
const name = getPersonName(filename, this.settings)
6262
if (name) this.peopleFileMap[name] = filename
6363
}
64-
this.updatePeopleMap()
64+
window.setTimeout(() => {
65+
this.updatePeopleMap()
66+
})
6567
}
6668
}
6769

0 commit comments

Comments
 (0)