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); // data.element.textcomplete(data.strategies, data.options);
// $('.textcomplete-wrapper').css('height', '100%').find('textarea').css('height', '100%'); // $('.textcomplete-wrapper').css('height', '100%').find('textarea').css('height', '100%');
var ready = true;
components.get('topic/quickreply/button').on('click', function(e) { components.get('topic/quickreply/button').on('click', function(e) {
e.preventDefault(); e.preventDefault();
if (!ready) {
return;
}
var replyMsg = components.get('topic/quickreply/text').val(); var replyMsg = components.get('topic/quickreply/text').val();
var replyData = { var replyData = {
tid: ajaxify.data.tid, tid: ajaxify.data.tid,
handle: undefined, handle: undefined,
content: replyMsg content: replyMsg
}; };
ready = false;
api.post(`/topics/${ajaxify.data.tid}`, replyData, function (err, data) { api.post(`/topics/${ajaxify.data.tid}`, replyData, function (err, data) {
ready = true;
if (err) { if (err) {
return app.alertError(err.message); return app.alertError(err.message);
} }

Loading…
Cancel
Save