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 @@ -29,7 +29,10 @@ const userProfileState = atom<UserProfile | null>({
2929
3030const accessTokenState = atom < string | null > ( {
3131 key : 'accessTokenState' ,
32- default : ( await get_access_token ( ) ) . access_token ,
32+ default : get_access_token ( ) . then ( value => value ?. access_token ?? null ) . catch ( ( err ) => {
33+ console . error ( "accessTokenState error" , err )
34+ return null
35+ } )
3336} ) ;
3437
3538const taskObjectState = atom < Task > ( {
@@ -39,7 +42,10 @@ const taskObjectState = atom<Task>({
3942
4043const activeTaskCategoryState = atom < number > ( {
4144 key : 'activeTaskCategoryState' ,
42- default : await SettingsStore . get < number > ( settings . storage . constants . last_active_category ) ?? - 1
45+ default : SettingsStore . get < number > ( settings . storage . constants . last_active_category ) . then ( value => value ?? - 1 ) . catch ( err => {
46+ console . error ( "activeTaskCategoryState error" , err )
47+ return - 1
48+ } )
4349} ) ;
4450
4551const activeCategoryTasksState = atom < task [ ] > ( {
You can’t perform that action at this time.
0 commit comments