Skip to content

Commit bee8fc0

Browse files
committed
refactor: ♻️ initialize vault writer initialisation earlier
1 parent 04800cb commit bee8fc0

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/main.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -619,6 +619,14 @@ export default class ReadwiseMirror extends Plugin {
619619
this.headerTemplate = this.settings.headerTemplate;
620620
this.highlightTemplate = this.settings.highlightTemplate;
621621

622+
this.deduplicatingVaultWriter = new DeduplicatingVaultWriter(
623+
this.app,
624+
this.settings,
625+
this.frontmatterManager,
626+
this.logger,
627+
this.notify
628+
);
629+
622630
if (!this.settings.apiToken) {
623631
this.notify.notice('Readwise: API Token not detected\nPlease enter in configuration page');
624632
this.notify.setStatusBarText('Readwise: API Token Required');
@@ -630,14 +638,6 @@ export default class ReadwiseMirror extends Plugin {
630638
else this.notify.setStatusBarText('Readwise: Click to Sync');
631639
}
632640

633-
this.deduplicatingVaultWriter = new DeduplicatingVaultWriter(
634-
this.app,
635-
this.settings,
636-
this.frontmatterManager,
637-
this.logger,
638-
this.notify
639-
);
640-
641641
this.registerDomEvent(statusBarItem, 'click', this.sync.bind(this));
642642

643643
this.addCommand({

0 commit comments

Comments
 (0)