From 7a6c15bb322914b73aaf811bee3aef08c4023f39 Mon Sep 17 00:00:00 2001 From: lilia Date: Wed, 15 Oct 2014 19:01:30 -0700 Subject: [PATCH] Avoid background thread overwriting outgoing messages --- js-deps/backbone.localStorage.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/js-deps/backbone.localStorage.js b/js-deps/backbone.localStorage.js index a842cf9af0c..7db8a66eb8f 100644 --- a/js-deps/backbone.localStorage.js +++ b/js-deps/backbone.localStorage.js @@ -70,6 +70,8 @@ extend(Backbone.LocalStorage.prototype, { // Save the current state of the **Store** to *localStorage*. save: function() { + var store = this.localStorage().getItem(this.name); + this.records = _.union(this.records, store && store.split(",")); this.localStorage().setItem(this.name, this.records.join(",")); },