mirror of
https://github.com/silvanocerza/github-gitless-sync.git
synced 2026-07-22 12:10:28 +00:00
Move ribbon icon init in layout ready callback
This commit is contained in:
parent
29200f33d4
commit
516186c671
1 changed files with 18 additions and 16 deletions
34
src/main.ts
34
src/main.ts
|
|
@ -36,22 +36,6 @@ export default class GitHubSyncPlugin extends Plugin {
|
|||
|
||||
this.addSettingTab(new GitHubSyncSettingsTab(this.app, this));
|
||||
|
||||
if (this.settings.showStatusBarItem) {
|
||||
this.showStatusBarItem();
|
||||
}
|
||||
|
||||
if (this.settings.showDownloadRibbonButton) {
|
||||
this.showDownloadAllRibbonIcon();
|
||||
}
|
||||
|
||||
if (this.settings.showUploadModifiedFilesRibbonButton) {
|
||||
this.showUploadModifiedFilesRibbonIcon();
|
||||
}
|
||||
|
||||
if (this.settings.showUploadAllFilesRibbonButton) {
|
||||
this.showUploadAllFilesRibbonIcon();
|
||||
}
|
||||
|
||||
this.client = new GithubClient(
|
||||
this.app.vault,
|
||||
this.metadataStore,
|
||||
|
|
@ -64,6 +48,24 @@ export default class GitHubSyncPlugin extends Plugin {
|
|||
// See the official Obsidian docs:
|
||||
// https://docs.obsidian.md/Reference/TypeScript+API/Vault/on('create')
|
||||
await this.startEventsHandlers();
|
||||
|
||||
// Load the ribbons after layout is ready so they're shown after the core
|
||||
// buttons
|
||||
if (this.settings.showStatusBarItem) {
|
||||
this.showStatusBarItem();
|
||||
}
|
||||
|
||||
if (this.settings.showDownloadRibbonButton) {
|
||||
this.showDownloadAllRibbonIcon();
|
||||
}
|
||||
|
||||
if (this.settings.showUploadModifiedFilesRibbonButton) {
|
||||
this.showUploadModifiedFilesRibbonIcon();
|
||||
}
|
||||
|
||||
if (this.settings.showUploadAllFilesRibbonButton) {
|
||||
this.showUploadAllFilesRibbonIcon();
|
||||
}
|
||||
});
|
||||
|
||||
this.addCommand({
|
||||
|
|
|
|||
Loading…
Reference in a new issue