OpenSlides/client/src/app/core/core-services/offline.service.ts

46 lines
1.1 KiB
TypeScript
Raw Normal View History

2018-10-26 10:23:14 +02:00
import { Injectable } from '@angular/core';
/**
* This service handles everything connected with being offline.
*
* TODO: This is just a stub. Needs to be done in the future; Maybe we cancel this whole concept
* of this service. We'll see whats happens here..
*/
@Injectable({
providedIn: 'root'
})
2019-02-08 17:24:32 +01:00
export class OfflineService {
2018-10-26 10:23:14 +02:00
private _offline = false;
public get offline(): boolean {
return this._offline;
}
/**
*/
2019-03-04 11:45:15 +01:00
public constructor() {}
2018-10-26 10:23:14 +02:00
/**
* Sets the offline flag. Restores the DataStoreService to the last known configuration.
*/
2019-03-04 11:45:15 +01:00
public goOfflineBecauseFailedWhoAmI(): void {
2018-10-26 10:23:14 +02:00
this._offline = true;
console.log('offline because whoami failed.');
}
/**
* TODO: Should be somehow connected to the websocket service.
*/
public goOfflineBecauseConnectionLost(): void {
this._offline = true;
console.log('offline because connection lost.');
}
/**
* TODO: Should be somehow connected to the websocket service.
*/
public goOnline(): void {
this._offline = false;
}
}