File tree Expand file tree Collapse file tree 1 file changed +14
-8
lines changed Expand file tree Collapse file tree 1 file changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -60,15 +60,21 @@ async function requestDashVersionInfo(config) {
60
60
}
61
61
} )
62
62
. then ( response => response . json ( ) )
63
- . catch ( ( ) => { } )
63
+ . catch ( ( ) => {
64
+ return { } ;
65
+ } )
64
66
. then ( body => {
65
- localStorage . setItem (
66
- 'cachedNewDashVersion' ,
67
- JSON . stringify ( body . version )
68
- ) ;
69
- localStorage . setItem ( 'cachedNewDashVersionLink' , body . link ) ;
70
- localStorage . setItem ( 'lastFetched' , Date . now ( ) ) ;
71
- return body ;
67
+ if ( body . version && body . link ) {
68
+ localStorage . setItem (
69
+ 'cachedNewDashVersion' ,
70
+ JSON . stringify ( body . version )
71
+ ) ;
72
+ localStorage . setItem ( 'cachedNewDashVersionLink' , body . link ) ;
73
+ localStorage . setItem ( 'lastFetched' , Date . now ( ) ) ;
74
+ return body ;
75
+ } else {
76
+ return { } ;
77
+ }
72
78
} ) ;
73
79
}
74
80
}
You can’t perform that action at this time.
0 commit comments