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