From 9ccfa8c6232b7a9f66c49461250cd9357e36bc95 Mon Sep 17 00:00:00 2001 From: Stefan Malzner Date: Thu, 8 Aug 2019 16:49:10 +0200 Subject: Fix service restriction on pro plan --- src/stores/ServicesStore.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/stores') diff --git a/src/stores/ServicesStore.js b/src/stores/ServicesStore.js index 513295b5e..e3b3fcf21 100644 --- a/src/stores/ServicesStore.js +++ b/src/stores/ServicesStore.js @@ -693,18 +693,20 @@ export default class ServicesStore extends Store { this.all.map((service, index) => { if (userHasReachedServiceLimit) { service.isServiceAccessRestricted = index >= serviceLimit; - service.restrictionType = RESTRICTION_TYPES.SERVICE_LIMIT; - if (index >= serviceLimit) { + if (service.isServiceAccessRestricted) { + service.restrictionType = RESTRICTION_TYPES.SERVICE_LIMIT; + debug('Restricting access to server due to service limit'); } } if (service.isUsingCustomUrl) { - service.isServiceAccessRestricted = features.isCustomUrlIncludedInCurrentPlan; - service.restrictionType = RESTRICTION_TYPES.CUSTOM_URL; + service.isServiceAccessRestricted = !features.isCustomUrlIncludedInCurrentPlan; + + if (service.isServiceAccessRestricted) { + service.restrictionType = RESTRICTION_TYPES.CUSTOM_URL; - if (features.isCustomUrlIncludedInCurrentPlan) { debug('Restricting access to server due to custom url'); } } -- cgit v1.2.3-54-g00ecf