nicer let syntax for fb
This commit is contained in:
@@ -3,11 +3,7 @@ import { FrontblockApiConf } from 'frontblock';
|
|||||||
import { SubscriptionResponse, parseResponse, SuccessResponse } from 'frontblock-generic/Types.js';
|
import { SubscriptionResponse, parseResponse, SuccessResponse } from 'frontblock-generic/Types.js';
|
||||||
import { environment } from "../../environments/environment"
|
import { environment } from "../../environments/environment"
|
||||||
|
|
||||||
let fb
|
const fb = environment.production?window["fb"]:{
|
||||||
if(environment.production){
|
|
||||||
fb = window["fb"]
|
|
||||||
}else{
|
|
||||||
fb = {
|
|
||||||
ApiClient : {
|
ApiClient : {
|
||||||
setConfig: async () => {
|
setConfig: async () => {
|
||||||
await new Promise((resolve, reject) => {
|
await new Promise((resolve, reject) => {
|
||||||
@@ -32,8 +28,6 @@ if(environment.production){
|
|||||||
},
|
},
|
||||||
unsubscribe: (uid) => new SuccessResponse(),
|
unsubscribe: (uid) => new SuccessResponse(),
|
||||||
quit: (uid) => new SuccessResponse()
|
quit: (uid) => new SuccessResponse()
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@Component({
|
@Component({
|
||||||
|
|||||||
@@ -1,23 +1,19 @@
|
|||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { fbind } from 'q';
|
|
||||||
import { FrontblockApiConf } from 'frontblock';
|
import { FrontblockApiConf } from 'frontblock';
|
||||||
import { environment } from "../../environments/environment"
|
import { environment } from "../../environments/environment"
|
||||||
|
|
||||||
let fb
|
const fb = environment.production ? window["fb"] : {
|
||||||
if(environment.production){
|
|
||||||
fb = window["fb"]
|
|
||||||
}else{
|
|
||||||
fb = {
|
|
||||||
ApiClient: {
|
ApiClient: {
|
||||||
setConfig: async () => {
|
setConfig: async () => {
|
||||||
await new Promise((resolve, reject) => {
|
await new Promise((resolve, reject) => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
resolve('Promise A win!');
|
resolve('Promise A win!');
|
||||||
}, 500)
|
}, 500)
|
||||||
})}
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'settings',
|
selector: 'settings',
|
||||||
template: `
|
template: `
|
||||||
|
|||||||
@@ -1,14 +1,9 @@
|
|||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { fbind } from 'q';
|
|
||||||
import { FrontblockApiConf } from 'frontblock';
|
import { FrontblockApiConf } from 'frontblock';
|
||||||
import { SubscriptionResponse, SuccessResponse, ErrorResponse, parseResponse } from 'frontblock-generic/Types.js';
|
import { SubscriptionResponse, SuccessResponse, parseResponse } from 'frontblock-generic/Types.js';
|
||||||
import { environment } from "../../environments/environment"
|
import { environment } from "../../environments/environment"
|
||||||
|
|
||||||
let fb
|
const fb = environment.production ? window["fb"] : {
|
||||||
if(environment.production){
|
|
||||||
fb = window["fb"]
|
|
||||||
}else{
|
|
||||||
fb = {
|
|
||||||
ApiClient: {
|
ApiClient: {
|
||||||
setConfig: async () => {
|
setConfig: async () => {
|
||||||
await new Promise((resolve, reject) => {
|
await new Promise((resolve, reject) => {
|
||||||
@@ -33,8 +28,6 @@ if(environment.production){
|
|||||||
},
|
},
|
||||||
unsubscribe: (uid) => new SuccessResponse(),
|
unsubscribe: (uid) => new SuccessResponse(),
|
||||||
quit: (uid) => new SuccessResponse()
|
quit: (uid) => new SuccessResponse()
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -36,26 +36,18 @@ SystemJS.config({ meta: { '*': { authorization: true } } });
|
|||||||
/** --------- */
|
/** --------- */
|
||||||
|
|
||||||
|
|
||||||
import { AfterViewInit, Component, Input, ViewChild } from '@angular/core';
|
import { AfterViewInit, Component } from '@angular/core';
|
||||||
import { SidebarComponent } from '../sidebar/sidebar.component';
|
import { SidebarComponent } from '../sidebar/sidebar.component';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import { FrontendPlugin, SidebarEntries, SidebarEntry } from "frontblock-generic/Plugin"
|
import { FrontendPlugin, SidebarEntries, SidebarEntry } from "frontblock-generic/Plugin"
|
||||||
import { SidebarEntryService } from '../sidebar-entry-service.service';
|
import { SidebarEntryService } from '../sidebar-entry-service.service';
|
||||||
import { environment } from "../../environments/environment"
|
import { environment } from "../../environments/environment"
|
||||||
|
|
||||||
|
const fb = environment.production ? window["fb"] : {
|
||||||
let fb
|
|
||||||
if(environment.production){
|
|
||||||
fb = window["fb"]
|
|
||||||
}else{
|
|
||||||
|
|
||||||
fb = {
|
|
||||||
PluginManager: {
|
PluginManager: {
|
||||||
getLoadedPluginNames: () => ["ApiClient", "PluginManager"]
|
getLoadedPluginNames: () => ["ApiClient", "PluginManager"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'dynamic-loader',
|
selector: 'dynamic-loader',
|
||||||
|
|||||||
Reference in New Issue
Block a user