@@ -74,7 +74,12 @@ public MainBlazorUI()
7474 {
7575 if ( Properties . Settings . Default . tarkovTrackerToken != "" )
7676 {
77- TarkovTracker . SetToken ( e . Profile . Id , Properties . Settings . Default . tarkovTrackerToken ) ;
77+ try {
78+ TarkovTracker . SetToken ( e . Profile . Id , Properties . Settings . Default . tarkovTrackerToken ) ;
79+ } catch ( Exception ex ) {
80+ messageLog . AddMessage ( $ "Error setting token from previously saved settings { ex . Message } ", "exception" ) ;
81+ }
82+
7883 Properties . Settings . Default . tarkovTrackerToken = "" ;
7984 Properties . Settings . Default . Save ( ) ;
8085 }
@@ -460,20 +465,20 @@ private async Task UpdateHideoutStations()
460465
461466 private async Task InitializeProgress ( )
462467 {
463- if ( TarkovTracker . GetToken ( eft . CurrentProfile . Id ) == "" )
464- {
465- messageLog . AddMessage ( "To automatically track task progress, set your Tarkov Tracker token in Settings" ) ;
466- return ;
467- }
468- messageLog . AddMessage ( $ "Using { eft . CurrentProfile . Type } profile") ;
469468 try
470469 {
471470 await TarkovTracker . SetProfile ( eft . CurrentProfile . Id ) ;
472- return ;
473471 }
474472 catch ( Exception ex )
475473 {
476- messageLog . AddMessage ( $ "Error getting Tarkov Tracker progress: { ex . Message } ") ;
474+ messageLog . AddMessage ( $ "Profile does not exist: { ex . Message } ") ;
475+ return ;
476+ }
477+ messageLog . AddMessage ( $ "Using { eft . CurrentProfile . Type } profile") ;
478+ if ( TarkovTracker . GetToken ( eft . CurrentProfile . Id ) == "" )
479+ {
480+ messageLog . AddMessage ( "To automatically track task progress, set your Tarkov Tracker token in Settings" ) ;
481+ return ;
477482 }
478483 try
479484 {
@@ -486,6 +491,7 @@ private async Task InitializeProgress()
486491 catch ( Exception ex )
487492 {
488493 messageLog . AddMessage ( $ "Error updating progress: { ex . Message } ") ;
494+ return ;
489495 }
490496 }
491497
0 commit comments