Skip to content

Commit fd3b0b4

Browse files
authored
Merge pull request #65 from JichouP:fix/#48
フォーローモードのインジゲーターを出す
2 parents c2fe34d + ebf0f6a commit fd3b0b4

File tree

3 files changed

+17
-5
lines changed

3 files changed

+17
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org).
1616

1717
### Changed
1818

19+
- [全環境] フォーローモードのインジゲーターを出すように変更 [#65](https://github.com/JichouP/Better-traQ/issues/65)
1920
- [全環境] デフォルト設定で、フォローモードをオンにするときに、自動でアクティビティタブに飛ぶように変更 [#63](https://github.com/JichouP/Better-traQ/issues/63)
2021
- [全環境] チャンネルフィルターにフォーカスして、現在のチャンネルを入力するとき、最後に / を付ける [#61](https://github.com/JichouP/Better-traQ/issues/61)
2122
- [全環境] 条件の名前を変更 [#51](https://github.com/JichouP/Better-traQ/issues/51) [#60](https://github.com/JichouP/Better-traQ/issues/60)

src/content_scripts/actions/toggleNavigationBarActivityFollowMode.ts

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,25 @@
11
import selectors from '../selectors';
2-
import followModeStore from '@/store/ForrowModeStore';
2+
import followModeStore from '@/store/FollowModeStore';
33

44
const 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

1114
const 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

File renamed without changes.

0 commit comments

Comments
 (0)