diff --git a/src/frontend/dashboard/src/app/ApiClient/apiclient-consumptions.component.ts b/src/frontend/dashboard/src/app/ApiClient/apiclient-consumptions.component.ts index d37b31e..cd43cc1 100644 --- a/src/frontend/dashboard/src/app/ApiClient/apiclient-consumptions.component.ts +++ b/src/frontend/dashboard/src/app/ApiClient/apiclient-consumptions.component.ts @@ -3,11 +3,7 @@ import { FrontblockApiConf } from 'frontblock'; import { SubscriptionResponse, parseResponse, SuccessResponse } from 'frontblock-generic/Types.js'; import { environment } from "../../environments/environment" -let fb -if(environment.production){ - fb = window["fb"] -}else{ - fb = { +const fb = environment.production?window["fb"]:{ ApiClient : { setConfig: async () => { await new Promise((resolve, reject) => { @@ -32,9 +28,7 @@ if(environment.production){ }, unsubscribe: (uid) => new SuccessResponse(), quit: (uid) => new SuccessResponse() - } - } } @Component({ selector: 'consumptions', diff --git a/src/frontend/dashboard/src/app/ApiClient/apiclient-settings-form.component.ts b/src/frontend/dashboard/src/app/ApiClient/apiclient-settings-form.component.ts index c9105e5..cb3e5c8 100644 --- a/src/frontend/dashboard/src/app/ApiClient/apiclient-settings-form.component.ts +++ b/src/frontend/dashboard/src/app/ApiClient/apiclient-settings-form.component.ts @@ -1,26 +1,22 @@ import { Component, OnInit } from '@angular/core'; -import { fbind } from 'q'; import { FrontblockApiConf } from 'frontblock'; import { environment } from "../../environments/environment" -let fb -if(environment.production){ - fb = window["fb"] -}else{ - fb = { - ApiClient : { - setConfig: async () => { - await new Promise((resolve, reject) => { - setTimeout(() => { - resolve('Promise A win!'); - }, 500) - })} +const fb = environment.production ? window["fb"] : { + ApiClient: { + setConfig: async () => { + await new Promise((resolve, reject) => { + setTimeout(() => { + resolve('Promise A win!'); + }, 500) + }) + } } - } } + @Component({ - selector: 'settings', - template: ` + selector: 'settings', + template: `