File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -634,12 +634,18 @@ export default class ReadwiseMirror extends Plugin {
634
634
this . _readwiseApi = new ReadwiseApi ( this . settings . apiToken , this . notify , this . _logger ) ;
635
635
636
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
- } ) ;
637
+ // Run sync if we have a valid token and auto sync is enabled
638
+ this . _readwiseApi
639
+ . validateToken ( )
640
+ . then ( ( isValid ) => {
641
+ if ( isValid && this . settings . autoSync ) {
642
+ this . notify . notice ( 'Readwise: Run auto sync on startup' ) ;
643
+ this . sync ( ) ;
644
+ }
645
+ } )
646
+ . catch ( ( error ) => {
647
+ this . notify . notice ( `Readwise: Error validating token, please check your API token: ${ error } ` ) ;
648
+ } ) ;
643
649
644
650
if ( this . settings . lastUpdated )
645
651
this . notify . setStatusBarText ( `Readwise: Updated ${ this . lastUpdatedHumanReadableFormat ( ) } ` ) ;
You can’t perform that action at this time.
0 commit comments