Просмотр исходного кода

Merge pull request #9148 from overleaf/tm-fix-custom-subscription-view

Remove Recurly property from personalSubscription object

GitOrigin-RevId: b1d86b8379471fcdeef15da9252d2c377ec673d6
Thomas 4 лет назад
Родитель
Сommit
bf96ca52c1

+ 7 - 0
services/web/app/src/Features/Subscription/SubscriptionViewModelBuilder.js

@@ -188,6 +188,13 @@ function buildUsersSubscriptionViewModel(user, callback) {
         personalSubscription.plan = plan
       }
 
+      // Subscription DB object contains a recurly property, used to cache trial info
+      // on the project-list. However, this can cause the wrong template to render,
+      // if we do not have any subscription data from Recurly (recurlySubscription)
+      if (personalSubscription) {
+        delete personalSubscription.recurly
+      }
+
       if (personalSubscription && recurlySubscription) {
         const tax = recurlySubscription.tax_in_cents || 0
         // Some plans allow adding more seats than the base plan provides.