From cdd9b9df4f274a062f8c3d8e2ad09a9b7e6ddff1 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Fri, 11 Dec 2020 16:53:05 -0600 Subject: [PATCH] trying fix --- .../AccountPaymentHistoryScreen.js.jsx.coffee | 6 ++++-- .../SessionMediaTracks.js.jsx.coffee | 14 ++++++++------ web/config/application.rb | 2 ++ web/config/initializers/gon.rb | 1 + 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/web/app/assets/javascripts/react-components/AccountPaymentHistoryScreen.js.jsx.coffee b/web/app/assets/javascripts/react-components/AccountPaymentHistoryScreen.js.jsx.coffee index 3e6e50d70..067063c2f 100644 --- a/web/app/assets/javascripts/react-components/AccountPaymentHistoryScreen.js.jsx.coffee +++ b/web/app/assets/javascripts/react-components/AccountPaymentHistoryScreen.js.jsx.coffee @@ -512,7 +512,9 @@ profileUtils = context.JK.ProfileUtils onStartPaypal: (e) -> e.preventDefault() - @paypal = window.recurly.PayPal({ display: { displayName: 'JamKazam Subscriptions' }}) + + @paypal = window.recurly.PayPal({ display: braintree: { clientAuthorization: gon.global.braintree_token} }) + #@paypal = window.recurly.PayPal({ display: { displayName: 'JamKazam Subscriptions' }}) @paypal.on('error', this.onPayPalError) @paypal.on('token', this.onPayPalToken) @paypal.start(); @@ -623,7 +625,7 @@ profileUtils = context.JK.ProfileUtils
{uncollectableMessage}
{header}
- Pay with Paypal + Pay with Paypal
{firstNameField} {lastNameField} diff --git a/web/app/assets/javascripts/react-components/SessionMediaTracks.js.jsx.coffee b/web/app/assets/javascripts/react-components/SessionMediaTracks.js.jsx.coffee index b832db230..a1a35e9ce 100644 --- a/web/app/assets/javascripts/react-components/SessionMediaTracks.js.jsx.coffee +++ b/web/app/assets/javascripts/react-components/SessionMediaTracks.js.jsx.coffee @@ -375,15 +375,17 @@ ChannelGroupIds = context.JK.ChannelGroupIds logger.debug("opening media control window") @childWindow = window.open("/popups/media-controls", 'Media Controls', 'scrollbars=yes,toolbar=no,status=no,height=155,width=350') @childWindow.PopupProps = {media: @state, jamTrackState: context.JamTrackStore.getState(), downloadingJamTrack: context.SessionStore.downloadingJamTrack, windowUnloaded: @windowUnloaded } - setTimeout(() => - @setState({popupOpen: true}) - , 1) + if !@state.popupOpen + setTimeout(() => + @setState({popupOpen: true}) + , 1) else if @childWindow? @childWindow.DontAutoCloseMedia = true @childWindow.close() @childWindow = null - setTimeout(() => - @setState({popupOpen: false}) - , 1) + if @state.popupOpen + setTimeout(() => + @setState({popupOpen: false}) + , 1) }) diff --git a/web/config/application.rb b/web/config/application.rb index 78125fc78..1b8ab913d 100644 --- a/web/config/application.rb +++ b/web/config/application.rb @@ -495,5 +495,7 @@ if defined?(Bundler) # braintree: merchant id: 5v5rwm94m2vrfbms # braintree: public key: 367d6dtdswvdr87s # braintree: private key: 8309b8f9c669cfa940f617eb9cac56ea + config.braintree_token = 'sandbox_pgjp8dvs_5v5rwm94m2vrfbms' + end end diff --git a/web/config/initializers/gon.rb b/web/config/initializers/gon.rb index b60748b9a..f19bd71e9 100644 --- a/web/config/initializers/gon.rb +++ b/web/config/initializers/gon.rb @@ -27,4 +27,5 @@ Gon.global.chat_opened_by_default = Rails.application.config.chat_opened_by_defa Gon.global.network_test_required = Rails.application.config.network_test_required Gon.global.musician_count = Rails.application.config.musician_count Gon.global.subscription_codes = Rails.application.config.subscription_codes +#Gon.global.braintree_token = Rails.application.config.braintree_token Gon.global.env = Rails.env