From 488690dc8d0fb51074edec6341a1dc4d02fd89a1 Mon Sep 17 00:00:00 2001 From: Sean Engelhardt Date: Fri, 29 Mar 2019 11:05:44 +0100 Subject: [PATCH] Add offline indicator Also adds a function to the offline service to "actually" determinate if we are offline or not --- .../src/app/core/core-services/offline.service.ts | 12 +++++++++++- .../components/projector/projector.component.html | 12 +++++++++++- .../components/projector/projector.component.scss | 11 +++++++++++ .../components/projector/projector.component.ts | 13 ++++++++++++- 4 files changed, 45 insertions(+), 3 deletions(-) diff --git a/client/src/app/core/core-services/offline.service.ts b/client/src/app/core/core-services/offline.service.ts index f13129e09..71ac6af68 100644 --- a/client/src/app/core/core-services/offline.service.ts +++ b/client/src/app/core/core-services/offline.service.ts @@ -1,4 +1,5 @@ import { Injectable } from '@angular/core'; +import { WebsocketService } from './websocket.service'; /** * This service handles everything connected with being offline. @@ -18,7 +19,16 @@ export class OfflineService { /** */ - public constructor() {} + public constructor(private socketService: WebsocketService) {} + + /** + * Determines of you are either in Offline mode or not connected via websocket + * + * @returns whether the client is offline or not connected + */ + public isOffline(): boolean { + return this.offline || !this.socketService.isConnected; + } /** * Sets the offline flag. Restores the DataStoreService to the last known configuration. diff --git a/client/src/app/shared/components/projector/projector.component.html b/client/src/app/shared/components/projector/projector.component.html index 947a894ed..a74167b73 100644 --- a/client/src/app/shared/components/projector/projector.component.html +++ b/client/src/app/shared/components/projector/projector.component.html @@ -1,5 +1,10 @@
+
+ + fiber_manual_record + +
- +