Don't re-write the message cache while we're processing it.
This commit is contained in:
@@ -344,9 +344,11 @@ Cosmopolite.prototype.subscribe = function(subjects, opt_messages, opt_lastID) {
|
||||
var messageStr = localStorage[key];
|
||||
if (messageStr) {
|
||||
var messages = JSON.parse(messageStr);
|
||||
subscription.use_cache = false;
|
||||
messages.forEach(function(msg) {
|
||||
msg['message'] = JSON.stringify(msg['message']);
|
||||
this.onMessage_(msg);
|
||||
subscription.use_cache = true;
|
||||
}.bind(this));
|
||||
}
|
||||
if (subscription.messages.length > 0) {
|
||||
|
||||
Reference in New Issue
Block a user