[FIX] im_livechat: double click on :) => 1 message
Prevent sending multiple messages when multiple clicks on one feedback icon. opw-1863312 closes #26047
This commit is contained in:
@@ -3,6 +3,7 @@ odoo.define('im_livechat.im_livechat', function (require) {
|
||||
|
||||
var local_storage = require('web.local_storage');
|
||||
var bus = require('bus.bus').bus;
|
||||
var concurrency = require('web.concurrency');
|
||||
var config = require('web.config');
|
||||
var core = require('web.core');
|
||||
var session = require('web.session');
|
||||
@@ -304,6 +305,7 @@ var Feedback = Widget.extend({
|
||||
this.channel_uuid = channel_uuid;
|
||||
this.server_origin = session.origin;
|
||||
this.rating = undefined;
|
||||
this.dp = new concurrency.DropPrevious();
|
||||
},
|
||||
|
||||
on_click_smiley: function (ev) {
|
||||
@@ -339,7 +341,7 @@ var Feedback = Widget.extend({
|
||||
rate: this.rating,
|
||||
reason : options.reason
|
||||
};
|
||||
return session.rpc('/im_livechat/feedback', args).then(function () {
|
||||
this.dp.add(session.rpc('/im_livechat/feedback', args)).then(function () {
|
||||
if (options.close) {
|
||||
var content = _.str.sprintf(_t("Rating: :rating_%d"), self.rating);
|
||||
if (options.reason) {
|
||||
|
||||
Reference in New Issue
Block a user