File tree 3 files changed +6
-6
lines changed
3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ function cached<T>(fn: () => T) {
10
10
cachedResult = fn ( ) ;
11
11
valid = true ;
12
12
}
13
- return cachedResult ;
13
+ return cachedResult as T ;
14
14
} ;
15
15
16
16
cachedFn . invalidate = ( ) => {
Original file line number Diff line number Diff line change @@ -111,11 +111,11 @@ const userModel = {
111
111
} ;
112
112
113
113
const throttledLoginCheck = throttle ( ( setData ) => {
114
- accountsModel . load ( ) ? .then ( ( oldUser ) => {
114
+ accountsModel . load ( ) . then ( ( oldUser ) => {
115
115
accountsModel . load . invalidate ( ) ;
116
- accountsModel . load ( ) ? .then ( ( newUser ) => {
116
+ accountsModel . load ( ) . then ( ( newUser ) => {
117
117
if ( ! isEqual ( oldUser , newUser ) ) {
118
- userModel . load ( ) ? .then ( setData ) ;
118
+ userModel . load ( ) . then ( setData ) ;
119
119
}
120
120
} ) ;
121
121
} ) ;
@@ -128,7 +128,7 @@ function useUserModel() {
128
128
const check = ( ) => throttledLoginCheck ( setData ) ;
129
129
130
130
window . addEventListener ( 'focus' , check ) ;
131
- userModel . load ( ) ? .then ( setData ) ;
131
+ userModel . load ( ) . then ( setData ) ;
132
132
133
133
return ( ) => window . removeEventListener ( 'focus' , check ) ;
134
134
} , [ ] ) ;
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import type {TrackedMouseEvent} from '~/components/shell/router-helpers/use-link
4
4
5
5
let userInfo : Partial < UserModelType > ;
6
6
7
- userModel . load ( ) ? .then ( ( i ) => {
7
+ userModel . load ( ) . then ( ( i ) => {
8
8
userInfo = i ;
9
9
} ) ;
10
10
You can’t perform that action at this time.
0 commit comments