Load all inbox convos before rendering
This is a better alternative to the fix in 0434c4b
, which causes
problems when creating a new conversation from entering a phone number.
// FREEBIE
This commit is contained in:
parent
57ac7c4fd7
commit
7fb4d3d8aa
4 changed files with 18 additions and 20 deletions
|
@ -35,9 +35,6 @@
|
||||||
// start a background worker for ecc
|
// start a background worker for ecc
|
||||||
textsecure.protocol_wrapper.startWorker();
|
textsecure.protocol_wrapper.startWorker();
|
||||||
|
|
||||||
// load the initial set of conversations into memory
|
|
||||||
ConversationController.updateInbox();
|
|
||||||
|
|
||||||
extension.onLaunched(function() {
|
extension.onLaunched(function() {
|
||||||
console.log('extension launched');
|
console.log('extension launched');
|
||||||
storage.onready(function() {
|
storage.onready(function() {
|
||||||
|
|
|
@ -74,7 +74,7 @@
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
updateInbox: function() {
|
updateInbox: function() {
|
||||||
conversations.fetchActive();
|
return conversations.fetchActive();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
31
js/index.js
31
js/index.js
|
@ -20,21 +20,22 @@
|
||||||
function render() {
|
function render() {
|
||||||
extension.windows.getBackground(function(bg) {
|
extension.windows.getBackground(function(bg) {
|
||||||
extension.windows.getCurrent(function(appWindow) {
|
extension.windows.getCurrent(function(appWindow) {
|
||||||
try {
|
bg.ConversationController.updateInbox().then(function() {
|
||||||
if (view) { view.remove(); }
|
try {
|
||||||
var $body = bg.$('body',document).empty();
|
if (view) { view.remove(); }
|
||||||
view = new bg.Whisper.InboxView({appWindow: appWindow});
|
var $body = bg.$('body',document).empty();
|
||||||
view.$el.prependTo($body);
|
view = new bg.Whisper.InboxView({appWindow: appWindow});
|
||||||
window.openConversation = function(conversation) {
|
view.$el.prependTo($body);
|
||||||
if (conversation) {
|
window.openConversation = function(conversation) {
|
||||||
view.openConversation(null, conversation);
|
if (conversation) {
|
||||||
}
|
view.openConversation(null, conversation);
|
||||||
};
|
}
|
||||||
openConversation(bg.getOpenConversation());
|
};
|
||||||
} catch (e) {
|
openConversation(bg.getOpenConversation());
|
||||||
logError(e);
|
} catch (e) {
|
||||||
}
|
logError(e);
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,7 +74,7 @@
|
||||||
}).render();
|
}).render();
|
||||||
|
|
||||||
this.inboxListView.listenTo(inboxCollection,
|
this.inboxListView.listenTo(inboxCollection,
|
||||||
'change:active_at',
|
'add change:active_at',
|
||||||
this.inboxListView.onChangeActiveAt);
|
this.inboxListView.onChangeActiveAt);
|
||||||
|
|
||||||
this.searchView = new Whisper.ConversationSearchView({
|
this.searchView = new Whisper.ConversationSearchView({
|
||||||
|
|
Loading…
Reference in a new issue