Address alpha feedback
This commit is contained in:
parent
191f5860a8
commit
90c2a97aa7
9 changed files with 78 additions and 42 deletions
|
@ -186,7 +186,7 @@
|
|||
this.maybeGrabLinkPreview.bind(this),
|
||||
200
|
||||
);
|
||||
this.debouncedSaveDraft = _.debounce(this.saveDraft.bind(this), 200);
|
||||
this.debouncedSaveDraft = _.debounce(this.saveDraft.bind(this), 2000);
|
||||
|
||||
this.render();
|
||||
|
||||
|
@ -2149,6 +2149,7 @@
|
|||
try {
|
||||
this.unload('delete messages');
|
||||
await this.model.destroyMessages();
|
||||
Whisper.events.trigger('unloadConversation', this.model.id);
|
||||
this.model.updateLastMessage();
|
||||
} catch (error) {
|
||||
window.log.error(
|
||||
|
@ -2421,10 +2422,10 @@
|
|||
},
|
||||
|
||||
async saveDraft(messageText) {
|
||||
if (
|
||||
(this.model.get('draft') && !messageText) ||
|
||||
messageText.length === 0
|
||||
) {
|
||||
const trimmed =
|
||||
messageText && messageText.length > 0 ? messageText.trim() : '';
|
||||
|
||||
if ((this.model.get('draft') && !messageText) || trimmed.length === 0) {
|
||||
this.model.set({
|
||||
draft: null,
|
||||
});
|
||||
|
|
|
@ -47,6 +47,11 @@
|
|||
// Make sure poppers are positioned properly
|
||||
window.dispatchEvent(new Event('resize'));
|
||||
},
|
||||
onUnload(conversationId) {
|
||||
if (this.lastConversation.id === conversationId) {
|
||||
this.lastConversation = null;
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
Whisper.AppLoadingScreen = Whisper.View.extend({
|
||||
|
@ -75,6 +80,9 @@
|
|||
el: this.$('.conversation-stack'),
|
||||
model: { window: options.window },
|
||||
});
|
||||
Whisper.events.on('unloadConversation', conversationId => {
|
||||
this.conversation_stack.onUnload(conversationId);
|
||||
});
|
||||
|
||||
if (!options.initialLoadComplete) {
|
||||
this.appLoadingScreen = new Whisper.AppLoadingScreen();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue