Browse Source
Bugfix/frequency of subscription interstitial (#8347)
Fix frequency of subscription interstitial
pull/8312/head^2
Thomas Kaul
5 days ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with
11 additions and
2 deletions
-
apps/api/src/app/user/user.service.ts
-
apps/client/src/app/services/settings-storage.service.ts
-
apps/client/src/app/services/user/user.service.ts
|
|
|
@ -435,7 +435,7 @@ export class UserService { |
|
|
|
frequency = 6; |
|
|
|
} |
|
|
|
|
|
|
|
if (analytics?.activityCount % frequency === 1) { |
|
|
|
if (frequency === 1 || analytics?.activityCount % frequency === 1) { |
|
|
|
currentPermissions.push(permissions.enableSubscriptionInterstitial); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -2,6 +2,8 @@ import { Service } from '@angular/core'; |
|
|
|
|
|
|
|
export const KEY_RANGE = 'range'; |
|
|
|
export const KEY_STAY_SIGNED_IN = 'staySignedIn'; |
|
|
|
export const KEY_SUBSCRIPTION_INTERSTITIAL_SHOWN = |
|
|
|
'subscriptionInterstitialShown'; |
|
|
|
export const KEY_TOKEN = 'auth-token'; |
|
|
|
|
|
|
|
@Service() |
|
|
|
|
|
|
|
@ -1,3 +1,4 @@ |
|
|
|
import { KEY_SUBSCRIPTION_INTERSTITIAL_SHOWN } from '@ghostfolio/client/services/settings-storage.service'; |
|
|
|
import { WebAuthnService } from '@ghostfolio/client/services/web-authn.service'; |
|
|
|
import { Filter, User } from '@ghostfolio/common/interfaces'; |
|
|
|
import { hasPermission, permissions } from '@ghostfolio/common/permissions'; |
|
|
|
@ -167,8 +168,14 @@ export class UserService extends ObservableStore<UserStoreState> { |
|
|
|
hasPermission( |
|
|
|
user.permissions, |
|
|
|
permissions.enableSubscriptionInterstitial |
|
|
|
) |
|
|
|
) && |
|
|
|
!window.sessionStorage.getItem(KEY_SUBSCRIPTION_INTERSTITIAL_SHOWN) |
|
|
|
) { |
|
|
|
window.sessionStorage.setItem( |
|
|
|
KEY_SUBSCRIPTION_INTERSTITIAL_SHOWN, |
|
|
|
'true' |
|
|
|
); |
|
|
|
|
|
|
|
const dialogRef = this.dialog.open< |
|
|
|
GfSubscriptionInterstitialDialogComponent, |
|
|
|
SubscriptionInterstitialDialogParams |
|
|
|
|