From f5f3fc7584987438dac6985ad49a205b2014e2fb Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Tue, 5 Feb 2013 11:35:22 +0100 Subject: [PATCH] now uses local storage bzr revid: nicolas.vanhoren@openerp.com-20130205103522-sapld2hhpgjda81a --- addons/live_support/static/ext/static/js/livesupport.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/addons/live_support/static/ext/static/js/livesupport.js b/addons/live_support/static/ext/static/js/livesupport.js index c0ad2e1be5d..e3523298274 100644 --- a/addons/live_support/static/ext/static/js/livesupport.js +++ b/addons/live_support/static/ext/static/js/livesupport.js @@ -140,7 +140,14 @@ define(["nova", "jquery", "underscore", "oeclient", "require"], function(nova, $ start_polling: function() { var self = this; - return connection.connector.call("/longpolling/im/gen_uuid", {}).then(function(uuid) { + var uuid = localStorage["oe_livesupport_uuid"]; + var def = $.when(uuid); + + if (! uuid) { + def = connection.connector.call("/longpolling/im/gen_uuid", {}); + } + return def.then(function(uuid) { + localStorage["oe_livesupport_uuid"] = uuid; return connection.getModel("im.user").call("get_by_user_id", [uuid]).then(function(my_id) { self.my_id = my_id["id"]; return self.ensure_users([self.my_id]).then(function() {