Skip to:
Content

BuddyPress.org

Changeset 13460


Ignore:
Timestamp:
04/22/2023 07:51:44 AM (2 years ago)
Author:
imath
Message:

BP Nouveau's message UI: reset the sending status after an error

So that it's possible to send a message or a reply once an error about missing data has been triggered, we need to reset the sending status to false.

Props dave.pullig

Fixes #8871 (branch 11.0)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/11.0/src/bp-templates/bp-nouveau/js/buddypress-messages.js

    r13458 r13460  
    655655
    656656                bp.Nouveau.Messages.displayFeedback( feedback, 'error' );
     657                self.model.set( 'sending', false, { silent: true } );
     658                $( button ).removeClass( 'disabled' ).prop( 'disabled', false );
     659
    657660                return;
    658661            }
     
    14121415
    14131416            this.collection.add( _.first( reply ) );
     1417
     1418            // Remove any existing feedback.
     1419            bp.Nouveau.Messages.removeFeedback();
    14141420        },
    14151421
     
    14171423            if ( response.feedback && response.type ) {
    14181424                bp.Nouveau.Messages.displayFeedback( response.feedback, response.type );
     1425            }
     1426
     1427            if ( this.reply.get( 'sending' ) ) {
     1428                this.reply.set( 'sending', false );
    14191429            }
    14201430        }
Note: See TracChangeset for help on using the changeset viewer.