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>({
29
29
30
30
const accessTokenState = atom < string | null > ( {
31
31
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
+ } )
33
36
} ) ;
34
37
35
38
const taskObjectState = atom < Task > ( {
@@ -39,7 +42,10 @@ const taskObjectState = atom<Task>({
39
42
40
43
const activeTaskCategoryState = atom < number > ( {
41
44
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
+ } )
43
49
} ) ;
44
50
45
51
const activeCategoryTasksState = atom < task [ ] > ( {
You can’t perform that action at this time.
0 commit comments