Revert "Remove ping requests now that it has been consolidated with status requests"

This reverts commit d9a6be2ac6.
This commit is contained in:
Gabe Kangas
2021-06-20 17:26:23 -07:00
parent 2aa8b70ead
commit f2b2e5c61c
3 changed files with 15 additions and 0 deletions

View File

@@ -41,6 +41,7 @@ import {
URL_CONFIG,
URL_OWNCAST,
URL_STATUS,
URL_VIEWER_PING,
WIDTH_SINGLE_COL,
} from './utils/constants.js';
@@ -187,6 +188,12 @@ export default class App extends Component {
this.handleOfflineMode();
this.handleNetworkingError(`Stream status: ${error}`);
});
// Ping the API to let them know we're an active viewer
fetch(URL_VIEWER_PING).catch((error) => {
this.handleOfflineMode();
this.handleNetworkingError(`Viewer PING error: ${error}`);
});
}
setConfigData(data = {}) {