From 2ae227360ab9af2dcc14a16d0498be526aef1471 Mon Sep 17 00:00:00 2001 From: Gabe Kangas Date: Sun, 19 Jul 2020 17:28:48 -0700 Subject: [PATCH] Hide viewer stats when in offline mode. Closes #66 --- webroot/index.html | 6 +++--- webroot/js/app.js | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/webroot/index.html b/webroot/index.html index 4a711c906..97e895a68 100644 --- a/webroot/index.html +++ b/webroot/index.html @@ -78,9 +78,9 @@
{{ streamStatus }} - {{ viewerCount }} {{ 'viewer' | plural(viewerCount) }}. - Max {{ sessionMaxViewerCount }} {{ 'viewer' | plural(sessionMaxViewerCount) }}. - {{ overallMaxViewerCount }} overall. + {{ viewerCount }} {{ 'viewer' | plural(viewerCount) }}. + Max {{ sessionMaxViewerCount }} {{ 'viewer' | plural(sessionMaxViewerCount) }}. + {{ overallMaxViewerCount }} overall.
diff --git a/webroot/js/app.js b/webroot/js/app.js index d690a26e8..a89e4a7c8 100644 --- a/webroot/js/app.js +++ b/webroot/js/app.js @@ -51,6 +51,7 @@ class Owncast { sessionMaxViewerCount: 0, streamStatus: MESSAGE_OFFLINE, // Default state. viewerCount: 0, + isOnline: false, // from config appVersion: '', @@ -281,6 +282,7 @@ class Owncast { // stop status timer and disable chat after some time. handleOfflineMode() { + this.vueApp.isOnline = false; clearInterval(this.streamDurationTimer); this.vueApp.streamStatus = MESSAGE_OFFLINE; if (this.streamStatus) { @@ -293,6 +295,7 @@ class Owncast { // play video! handleOnlineMode() { this.vueApp.playerOn = true; + this.vueApp.isOnline = true; this.vueApp.streamStatus = MESSAGE_ONLINE; this.player.startPlayer();