11import selectors from '../selectors' ;
2- import followModeStore from '@/store/ForrowModeStore ' ;
2+ import followModeStore from '@/store/FollowModeStore ' ;
33
44const isActivity = ( ) => {
55 const navigationBarTitleSelector = `${ selectors . navigationBar ( ) } > h2` ;
6- const el = document . querySelector < HTMLDivElement > ( navigationBarTitleSelector ) ;
7- if ( ! el ) return false ;
8- return el . innerHTML === 'アクティビティ' ;
6+ const navigationBarTitleEl = document . querySelector < HTMLDivElement > (
7+ navigationBarTitleSelector
8+ ) ;
9+ if ( ! navigationBarTitleEl ) return false ;
10+
11+ return navigationBarTitleEl . innerHTML . includes ( 'アクティビティ' ) ;
912} ;
1013
1114const toggleNavigationBarActivityFollowMode = ( ) => {
15+ const navigationBarTitleSelector = `${ selectors . navigationBar ( ) } > h2` ;
16+ const navigationBarTitleEl = document . querySelector < HTMLDivElement > (
17+ navigationBarTitleSelector
18+ ) ;
19+ if ( ! navigationBarTitleEl ) return ;
20+
1221 if ( followModeStore . isFollowMode ( ) ) {
22+ navigationBarTitleEl . innerHTML = 'アクティビティ' ;
1323 window . clearInterval ( followModeStore . getHandler ( ) ) ;
1424 return followModeStore . setHandler ( 0 ) ;
1525 }
@@ -31,7 +41,8 @@ const toggleNavigationBarActivityFollowMode = () => {
3141 followModeStore . setLatestMessage ( latestMessage ) ;
3242 latestMessage . click ( ) ;
3343 }
34- } , 1000 ) ;
44+ } , 100 ) ;
45+ navigationBarTitleEl . innerHTML = 'アクティビティ🔴' ;
3546 followModeStore . setHandler ( handler ) ;
3647} ;
3748
0 commit comments