-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implementation of reset unclear (to me) #72
Comments
@manuel-reil it is difficult to say what the specific issue you're having is without seeming an example. FWIW we do have a test case for this https://github.com/dockyard/ember-async-button/blob/f2445374e64348ed0b310464588aa6d6e912729f/tests/acceptance/button-test.js#L179-L189 |
I'm having an issue with the reset functionality as well. Here is what I have: {{async-button
action=(action 'createIntegration')
default='Connect With Stripe'
pending='Connecting...'
reset=resetButton
}} import Ember from 'ember';
import env from 'aeonvera/config/environment';
export default Ember.Component.extend({
torii: Ember.inject.service(),
resetButton: false,
actions: {
createIntegration() {
this.get('torii').open('stripe-connect').then(function(result) {
this.set('authorizationCode', result.authorizationCode);
console.log(result);
}.bind(this), error => {
this.get('flashMessages').alert(error);
this.set('resetButton', true);
});
}
}
}); what I want to happen is on failure, to re-enable the button. Right now, it stays disabled. |
@NullVoxPopuli I believe if you return the promise from your action, you will get your desired behavior. |
i just tried this: createIntegration() {
return this.get('torii').open('stripe-connect').then(function(result) {
this.set('authorizationCode', result.authorizationCode);
console.log(result);
}.bind(this), error => {
this.get('flashMessages').alert(error);
return this.set('resetButton', true);
});
} to no avail. :-\ |
any other ideas? :-\ |
@NullVoxPopuli I forgot to ask: what version of |
oh ok, I'll try master when I get a chance. thanks! |
Hi,
first, thanks for the work on this.
At least to me, the implementation of reset is unclear. See the following real life example:
The states default and pending are working as expected. Only I cannot see the state fulfilled as it switches immediately back to default.
My thoughts:
Thank you for a hint.
Kind regards,
Manuel
The text was updated successfully, but these errors were encountered: