mirror of
https://github.com/overleaf/overleaf.git
synced 2025-03-30 02:37:06 +00:00
only setup recurly once for subscription dashboard and apply async to make sure updates on pricing are applied
This commit is contained in:
parent
7030d5f822
commit
79e7f82a36
1 changed files with 8 additions and 3 deletions
|
@ -2,7 +2,10 @@ define [
|
|||
"base"
|
||||
], (App)->
|
||||
SUBSCRIPTION_URL = "/user/subscription/update"
|
||||
recurly.configure window.recurlyApiKey
|
||||
|
||||
setupReturly = _.once ->
|
||||
recurly?.configure window.recurlyApiKey
|
||||
|
||||
|
||||
App.controller "CurrenyDropdownController", ($scope, MultiCurrencyPricing, $q)->
|
||||
|
||||
|
@ -14,7 +17,7 @@ define [
|
|||
|
||||
|
||||
App.controller "ChangePlanFormController", ($scope, $modal, MultiCurrencyPricing)->
|
||||
|
||||
setupReturly()
|
||||
|
||||
taxRate = window.taxRate
|
||||
|
||||
|
@ -41,7 +44,9 @@ define [
|
|||
pricing = recurly.Pricing()
|
||||
pricing.plan(planCode, { quantity: 1 }).done (price)->
|
||||
totalPriceExTax = parseFloat(price.next.total)
|
||||
$scope.prices[planCode] = $scope.currencySymbol + (totalPriceExTax + (totalPriceExTax * taxRate))
|
||||
$scope.$evalAsync () ->
|
||||
$scope.prices[planCode] = $scope.currencySymbol + (totalPriceExTax + (totalPriceExTax * taxRate))
|
||||
|
||||
price = ""
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue