0

Hide viewer count when offline (#1091)

* Hide viewer count when offline

* cleanup
This commit is contained in:
Meisam 2021-06-10 19:59:51 +02:00 committed by GitHub
parent e396207c08
commit 2659dc3646
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -227,6 +227,11 @@ export default class VideoOnly extends Component {
const { logo = TEMP_IMAGE, customStyles } = configData; const { logo = TEMP_IMAGE, customStyles } = configData;
const viewerCountMessage =
streamOnline && viewerCount > 0
? html`${viewerCount} ${pluralize('viewer', viewerCount)}`
: null;
const mainClass = playerActive ? 'online' : ''; const mainClass = playerActive ? 'online' : '';
const poster = isPlaying const poster = isPlaying
@ -257,9 +262,7 @@ export default class VideoOnly extends Component {
class="flex text-center flex-row justify-between font-mono py-2 px-8 bg-gray-900 text-indigo-200 shadow-md border-b border-gray-100 border-solid" class="flex text-center flex-row justify-between font-mono py-2 px-8 bg-gray-900 text-indigo-200 shadow-md border-b border-gray-100 border-solid"
> >
<span>${streamStatusMessage}</span> <span>${streamStatusMessage}</span>
<span id="stream-viewer-count" <span id="stream-viewer-count">${viewerCountMessage}</span>
>${viewerCount} ${pluralize('viewer', viewerCount)}.</span
>
</section> </section>
</main> </main>
`; `;