Skip to content

Commit

Permalink
Merge pull request #554 from felipecrs/patch-2
Browse files Browse the repository at this point in the history
Improve loading messages
  • Loading branch information
AlexxIT authored Aug 24, 2023
2 parents fb18cc0 + 383c7a0 commit 616aa6b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions custom_components/webrtc/www/webrtc-camera.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class WebRTCCamera extends VideoRTC {

setStatus(mode, status) {
const divMode = this.querySelector('.mode').innerText;
if (mode === 'error' && divMode !== 'loading1' && divMode !== 'loading2') return;
if (mode === 'error' && divMode !== 'Loading..' && divMode !== 'Loading...') return;

this.querySelector('.mode').innerText = mode;
this.querySelector('.status').innerText = status || '';
Expand Down Expand Up @@ -138,9 +138,9 @@ class WebRTCCamera extends VideoRTC {
if (!this.isConnected || this.ws || this.pc) return false;

const divMode = this.querySelector('.mode').innerText;
if (divMode === 'loading1') return;
if (divMode === 'Loading..') return;

this.setStatus('loading1');
this.setStatus('Loading..');

this.hass.callWS({
type: 'auth/sign_path', path: '/api/webrtc/ws'
Expand All @@ -156,7 +156,7 @@ class WebRTCCamera extends VideoRTC {
this.wsURL += '&entity=' + this.config.entity;
}
if (super.onconnect()) {
this.setStatus('loading2');
this.setStatus('Loading...');
} else {
this.setStatus('error', 'unable to connect');
}
Expand Down

0 comments on commit 616aa6b

Please sign in to comment.