mirror of
https://github.com/beestat/app.git
synced 2025-05-24 02:14:03 -04:00
Fixed #400 - Clicking "Continue to Payment" can result in runaway API calls
This commit is contained in:
parent
212a8e26db
commit
91f3110584
@ -280,12 +280,20 @@ beestat.component.card.contribute.prototype.decorate_contents_ = function(parent
|
||||
parent.appendChild($(button_container));
|
||||
|
||||
const continue_tile = new beestat.component.tile()
|
||||
.set_background_color(beestat.style.color.green.base)
|
||||
.set_background_hover_color(beestat.style.color.green.light)
|
||||
.set_text_color('#fff')
|
||||
.set_size('large')
|
||||
.set_icon('credit_card_lock')
|
||||
.set_text('Continue to Payment');
|
||||
|
||||
if (this.state_.stripe_connecting === true) {
|
||||
continue_tile
|
||||
.set_background_color(beestat.style.color.gray.base)
|
||||
.set_background_hover_color();
|
||||
} else {
|
||||
continue_tile
|
||||
.set_background_color(beestat.style.color.green.base)
|
||||
.set_background_hover_color(beestat.style.color.green.light)
|
||||
.set_text_color('#fff');
|
||||
|
||||
continue_tile.addEventListener('click', function() {
|
||||
self.state_.stripe_connecting = true;
|
||||
|
||||
@ -300,6 +308,7 @@ beestat.component.card.contribute.prototype.decorate_contents_ = function(parent
|
||||
self.rerender();
|
||||
}, 5000);
|
||||
});
|
||||
}
|
||||
|
||||
continue_tile.render($(button_container));
|
||||
|
||||
@ -312,7 +321,6 @@ beestat.component.card.contribute.prototype.decorate_contents_ = function(parent
|
||||
|
||||
window.setTimeout(function() {
|
||||
api_call.send();
|
||||
self.rerender();
|
||||
}, 5000);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user