File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -633,6 +633,14 @@ export default class ReadwiseMirror extends Plugin {
633
633
} else {
634
634
this . _readwiseApi = new ReadwiseApi ( this . settings . apiToken , this . notify , this . _logger ) ;
635
635
636
+ this . logger . info ( 'Validating Readwise token ...' ) ;
637
+ this . _readwiseApi . validateToken ( ) . then ( ( isValid ) => {
638
+ if ( isValid && this . settings . autoSync ) {
639
+ this . notify . notice ( 'Readwise: Run auto sync on startup' ) ;
640
+ this . sync ( ) ;
641
+ }
642
+ } ) ;
643
+
636
644
if ( this . settings . lastUpdated )
637
645
this . notify . setStatusBarText ( `Readwise: Updated ${ this . lastUpdatedHumanReadableFormat ( ) } ` ) ;
638
646
else this . notify . setStatusBarText ( 'Readwise: Click to Sync' ) ;
@@ -694,8 +702,6 @@ export default class ReadwiseMirror extends Plugin {
694
702
) ;
695
703
696
704
this . addSettingTab ( new ReadwiseMirrorSettingTab ( this . app , this , this . notify , this . frontmatterManager ) ) ;
697
-
698
- if ( this . settings . autoSync ) this . sync ( ) ;
699
705
}
700
706
701
707
async loadSettings ( ) {
You can’t perform that action at this time.
0 commit comments