Skip to content

Commit

Permalink
Fix Hide Viewer Count for Realm (stream-labs#4937)
Browse files Browse the repository at this point in the history
  • Loading branch information
gettinToasty authored Apr 12, 2024
1 parent a047a2d commit 9caf8c2
Showing 1 changed file with 12 additions and 18 deletions.
30 changes: 12 additions & 18 deletions app/components-react/root/LiveDock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ class LiveDockController {
return this.streamingService.isStreaming;
}

get currentViewers() {
return this.streamingService.views.viewerCount.toString();
}

get pageSlot() {
return EAppPageSlot.Chat;
}
Expand Down Expand Up @@ -80,17 +84,6 @@ class LiveDockController {
return $i(`images/sleeping-kevin-${mode}.png`);
}

get hideViewerCount() {
return this.customizationService.state.hideViewerCount;
}

get viewerCount() {
if (this.hideViewerCount) {
return $t('Viewers Hidden');
}
return this.streamingService.views.viewerCount.toString();
}

get hideStyleBlockers() {
return this.windowsService.state.main.hideStyleBlockers;
}
Expand Down Expand Up @@ -258,9 +251,6 @@ function LiveDock(p: { onLeft: boolean }) {
const [visibleChat, setVisibleChat] = useState('default');
const [elapsedStreamTime, setElapsedStreamTime] = useState('');

const liveDockSize = useRealmObject(Services.CustomizationService.state).livedockSize;
const collapsed = useRealmObject(Services.CustomizationService.state).livedockCollapsed;

const {
isPlatform,
isStreaming,
Expand All @@ -269,8 +259,7 @@ function LiveDock(p: { onLeft: boolean }) {
chatTabs,
applicationLoading,
hideStyleBlockers,
hideViewerCount,
viewerCount,
currentViewers,
pageSlot,
canAnimate,
liveText,
Expand All @@ -285,16 +274,21 @@ function LiveDock(p: { onLeft: boolean }) {
'chatTabs',
'applicationLoading',
'hideStyleBlockers',
'hideViewerCount',
'viewerCount',
'pageSlot',
'canAnimate',
'currentViewers',
'liveText',
'isPopOutAllowed',
'streamingStatus',
]),
);

const liveDockSize = useRealmObject(Services.CustomizationService.state).livedockSize;
const collapsed = useRealmObject(Services.CustomizationService.state).livedockCollapsed;
const hideViewerCount = useRealmObject(Services.CustomizationService.state).hideViewerCount;

const viewerCount = hideViewerCount ? $t('Viewers Hidden') : currentViewers;

useEffect(() => {
if (streamingStatus === EStreamingState.Starting && collapsed) {
ctrl.setCollapsed(false);
Expand Down

0 comments on commit 9caf8c2

Please sign in to comment.