File tree Expand file tree Collapse file tree 1 file changed +16
-14
lines changed
Expand file tree Collapse file tree 1 file changed +16
-14
lines changed Original file line number Diff line number Diff line change @@ -23,27 +23,29 @@ async function refresh(withNotifications: boolean) {
2323 periodInMinutes : 1 ,
2424 } ) ;
2525
26- const accessToken = await stores . accessToken . get ( ) ;
26+ if ( navigator . onLine ) {
27+ const accessToken = await stores . accessToken . get ( ) ;
2728
28- let currentUser : HelixUser | null = null ;
29- let followedStreams = new Array < HelixStream > ( ) ;
29+ let currentUser : HelixUser | null = null ;
30+ let followedStreams = new Array < HelixStream > ( ) ;
3031
31- if ( accessToken ) {
32- currentUser = await getCurrentUser ( ) ;
32+ if ( accessToken ) {
33+ currentUser = await getCurrentUser ( ) ;
3334
34- if ( currentUser ) {
35- followedStreams = await getFollowedStreams ( currentUser . id ) ;
35+ if ( currentUser ) {
36+ followedStreams = await getFollowedStreams ( currentUser . id ) ;
37+ }
3638 }
37- }
3839
39- refreshActionBadge ( ! ! currentUser , followedStreams . length ) ;
40+ refreshActionBadge ( ! ! currentUser , followedStreams . length ) ;
4041
41- if ( withNotifications ) {
42- sendStreamNotifications ( await filterNewStreams ( followedStreams ) ) ;
43- }
42+ if ( withNotifications ) {
43+ sendStreamNotifications ( await filterNewStreams ( followedStreams ) ) ;
44+ }
4445
45- stores . currentUser . set ( currentUser ) ;
46- stores . followedStreams . set ( followedStreams ) ;
46+ stores . currentUser . set ( currentUser ) ;
47+ stores . followedStreams . set ( followedStreams ) ;
48+ }
4749}
4850
4951async function checkAlaram ( ) {
You can’t perform that action at this time.
0 commit comments