now uses local storage

bzr revid: nicolas.vanhoren@openerp.com-20130205103522-sapld2hhpgjda81a
This commit is contained in:
niv-openerp 2013-02-05 11:35:22 +01:00
parent e2a753901d
commit f5f3fc7584
1 changed files with 8 additions and 1 deletions

View File

@ -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() {