mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-22 01:22:54 +00:00
refactor: replace TSLint with ESLint
This commit is contained in:
committed by
Jovan Krunić
parent
67fb4a43c9
commit
d696215d08
@@ -31,7 +31,7 @@ import {
|
||||
/**
|
||||
* Key to store config in storage module
|
||||
*
|
||||
* @TODO: Issue #41 centralise storage keys
|
||||
* TODO: Issue #41 centralise storage keys
|
||||
*/
|
||||
export const STORAGE_KEY_CONFIG = 'stapps.config';
|
||||
|
||||
@@ -44,18 +44,22 @@ export class ConfigProvider {
|
||||
* Api client
|
||||
*/
|
||||
client: Client;
|
||||
|
||||
/**
|
||||
* App configuration as IndexResponse
|
||||
*/
|
||||
config: SCIndexResponse;
|
||||
|
||||
/**
|
||||
* First session indicator
|
||||
*/
|
||||
firstSession = true;
|
||||
|
||||
/**
|
||||
* Initialised status flag of config provider
|
||||
*/
|
||||
initialised = false;
|
||||
|
||||
/**
|
||||
* Version of the @openstapps/core package that app is using
|
||||
*/
|
||||
@@ -68,10 +72,16 @@ export class ConfigProvider {
|
||||
* @param swHttpClient Api client
|
||||
* @param logger An angular logger
|
||||
*/
|
||||
constructor(private readonly storageProvider: StorageProvider,
|
||||
swHttpClient: StAppsWebHttpClient,
|
||||
private readonly logger: NGXLogger) {
|
||||
this.client = new Client(swHttpClient, environment.backend_url, environment.backend_version);
|
||||
constructor(
|
||||
private readonly storageProvider: StorageProvider,
|
||||
swHttpClient: StAppsWebHttpClient,
|
||||
private readonly logger: NGXLogger,
|
||||
) {
|
||||
this.client = new Client(
|
||||
swHttpClient,
|
||||
environment.backend_url,
|
||||
environment.backend_version,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -80,7 +90,7 @@ export class ConfigProvider {
|
||||
async fetch(): Promise<SCIndexResponse> {
|
||||
try {
|
||||
return await this.client.handshake(this.scVersion);
|
||||
} catch (error) {
|
||||
} catch {
|
||||
throw new ConfigFetchError();
|
||||
}
|
||||
}
|
||||
@@ -124,7 +134,10 @@ export class ConfigProvider {
|
||||
this.initialised = true;
|
||||
this.logger.log(`initialised configuration from storage`);
|
||||
if (this.config.backend.SCVersion !== this.scVersion) {
|
||||
loadError = new WrongConfigVersionInStorage(this.scVersion, this.config.backend.SCVersion);
|
||||
loadError = new WrongConfigVersionInStorage(
|
||||
this.scVersion,
|
||||
this.config.backend.SCVersion,
|
||||
);
|
||||
this.logger.warn(loadError);
|
||||
}
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user