mirror of
https://github.com/mempool/mempool.git
synced 2025-01-18 21:32:55 +01:00
make prod domains configurable
This commit is contained in:
parent
cb63d17a2f
commit
1a7f475220
@ -84,13 +84,7 @@ export class AccelerateCheckout implements OnInit, OnDestroy {
|
||||
timePaid: number = 0; // time acceleration requested
|
||||
math = Math;
|
||||
isMobile: boolean = window.innerWidth <= 767.98;
|
||||
isProdDomain = ['mempool.space',
|
||||
'mempool-staging.va1.mempool.space',
|
||||
'mempool-staging.fmt.mempool.space',
|
||||
'mempool-staging.fra.mempool.space',
|
||||
'mempool-staging.tk7.mempool.space',
|
||||
'mempool-staging.sg1.mempool.space'
|
||||
].indexOf(document.location.hostname) > -1;
|
||||
isProdDomain = false;
|
||||
|
||||
private _step: CheckoutStep = 'summary';
|
||||
simpleMode: boolean = true;
|
||||
@ -143,6 +137,7 @@ export class AccelerateCheckout implements OnInit, OnDestroy {
|
||||
private authService: AuthServiceMempool,
|
||||
private enterpriseService: EnterpriseService,
|
||||
) {
|
||||
this.isProdDomain = this.stateService.env.PROD_DOMAINS.indexOf(document.location.hostname) > -1;
|
||||
this.accelerationUUID = insecureRandomUUID();
|
||||
|
||||
// Check if Apple Pay available
|
||||
|
@ -78,6 +78,7 @@ export interface Env {
|
||||
PACKAGE_JSON_VERSION_MEMPOOL_SPACE?: string;
|
||||
SERVICES_API?: string;
|
||||
customize?: Customization;
|
||||
PROD_DOMAINS: string[];
|
||||
}
|
||||
|
||||
const defaultEnv: Env = {
|
||||
@ -113,6 +114,7 @@ const defaultEnv: Env = {
|
||||
'PUBLIC_ACCELERATIONS': false,
|
||||
'ADDITIONAL_CURRENCIES': false,
|
||||
'SERVICES_API': 'https://mempool.space/api/v1/services',
|
||||
'PROD_DOMAINS': [],
|
||||
};
|
||||
|
||||
@Injectable({
|
||||
@ -206,6 +208,10 @@ export class StateService {
|
||||
const browserWindow = window || {};
|
||||
// @ts-ignore
|
||||
const browserWindowEnv = browserWindow.__env || {};
|
||||
if (browserWindowEnv.PROD_DOMAINS && typeof(browserWindowEnv.PROD_DOMAINS) === 'string') {
|
||||
browserWindowEnv.PROD_DOMAINS = browserWindowEnv.PROD_DOMAINS.split(',');
|
||||
}
|
||||
|
||||
this.env = Object.assign(defaultEnv, browserWindowEnv);
|
||||
|
||||
if (defaultEnv.BASE_MODULE !== 'mempool') {
|
||||
|
Loading…
Reference in New Issue
Block a user