fix: handle multi-send on quick reply (#532)

main
Anton Grigoryev 3 years ago committed by GitHub
parent 137c500412
commit 0a7adc9474
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -30,15 +30,23 @@ define('persona/quickreply', [
// data.element.textcomplete(data.strategies, data.options);
// $('.textcomplete-wrapper').css('height', '100%').find('textarea').css('height', '100%');
var ready = true;
components.get('topic/quickreply/button').on('click', function(e) {
e.preventDefault();
if (!ready) {
return;
}
var replyMsg = components.get('topic/quickreply/text').val();
var replyData = {
tid: ajaxify.data.tid,
handle: undefined,
content: replyMsg
};
ready = false;
api.post(`/topics/${ajaxify.data.tid}`, replyData, function (err, data) {
ready = true;
if (err) {
return app.alertError(err.message);
}

Loading…
Cancel
Save