|
|
|
@ -3,7 +3,7 @@ import { LOCALE_ID } from '@angular/core';
|
|
|
|
|
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
|
|
|
|
import { locale } from '@ghostfolio/common/config';
|
|
|
|
|
import { InfoItem } from '@ghostfolio/common/interfaces';
|
|
|
|
|
import { permissions } from '@ghostfolio/common/permissions';
|
|
|
|
|
import { filterGlobalPermissions } from '@ghostfolio/common/permissions';
|
|
|
|
|
|
|
|
|
|
import { AppModule } from './app/app.module';
|
|
|
|
|
import { environment } from './environments/environment';
|
|
|
|
@ -11,12 +11,14 @@ import { environment } from './environments/environment';
|
|
|
|
|
(async () => {
|
|
|
|
|
const response = await fetch('/api/v1/info');
|
|
|
|
|
const info: InfoItem = await response.json();
|
|
|
|
|
const utmSource = <'ios' | 'trusted-web-activity'>(
|
|
|
|
|
window.localStorage.getItem('utm_source')
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
if (window.localStorage.getItem('utm_source') === 'trusted-web-activity') {
|
|
|
|
|
info.globalPermissions = info.globalPermissions.filter(
|
|
|
|
|
(permission) => permission !== permissions.enableSubscription
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
info.globalPermissions = filterGlobalPermissions(
|
|
|
|
|
info.globalPermissions,
|
|
|
|
|
utmSource
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
(window as any).info = info;
|
|
|
|
|
|
|
|
|
|