diff --git a/src/lib/appManagers/appDialogsManager.ts b/src/lib/appManagers/appDialogsManager.ts index 4257971d..e4fb6c44 100644 --- a/src/lib/appManagers/appDialogsManager.ts +++ b/src/lib/appManagers/appDialogsManager.ts @@ -301,14 +301,15 @@ export class AppDialogsManager { this.setUnreadMessages(dialog); // возможно это не нужно, но нужно менять is-muted }); - rootScope.addEventListener('dialog_draft', ({peerId}) => { - const dialog = appMessagesManager.getDialogOnly(peerId); - if(dialog) { + rootScope.addEventListener('dialog_draft', ({dialog, drop, peerId}) => { + if(drop) { + this.sortedList.delete(peerId); + } else { this.updateDialog(dialog); + } - if(this.processContact) { - this.processContact(peerId); - } + if(this.processContact) { + this.processContact(peerId); } }); diff --git a/src/lib/appManagers/appMessagesManager.ts b/src/lib/appManagers/appMessagesManager.ts index 1d5f6f6f..59b98188 100644 --- a/src/lib/appManagers/appMessagesManager.ts +++ b/src/lib/appManagers/appMessagesManager.ts @@ -299,16 +299,19 @@ export class AppMessagesManager { if(!threadId) { dialog.draft = draft; + let drop = false; if(!draft && !appMessagesIdsManager.getServerMessageId(dialog.top_message)) { - this.dialogsStorage.dropDialogWithEvent(peerId); - return; + this.dialogsStorage.dropDialog(peerId); + drop = true; + } else { + this.dialogsStorage.generateIndexForDialog(dialog); + this.dialogsStorage.pushDialog(dialog); } - this.dialogsStorage.generateIndexForDialog(dialog); - this.dialogsStorage.pushDialog(dialog); - rootScope.dispatchEvent('dialog_draft', { peerId, + dialog, + drop, draft, index: dialog.index }); diff --git a/src/lib/rootScope.ts b/src/lib/rootScope.ts index bc8f0e3d..1f55aee3 100644 --- a/src/lib/rootScope.ts +++ b/src/lib/rootScope.ts @@ -36,7 +36,7 @@ export type BroadcastEvents = { 'filter_update': MyDialogFilter, 'filter_order': number[], - 'dialog_draft': {peerId: number, draft: MyDraftMessage | undefined, index: number}, + 'dialog_draft': {peerId: number, dialog: Dialog, drop: boolean, draft: MyDraftMessage | undefined, index: number}, 'dialog_unread': {peerId: number}, 'dialog_flush': {peerId: number}, 'dialog_drop': {peerId: number, dialog?: Dialog}, diff --git a/src/scss/style.scss b/src/scss/style.scss index 9493a7b0..1cc362cd 100644 --- a/src/scss/style.scss +++ b/src/scss/style.scss @@ -860,8 +860,14 @@ not screen and ( -o-min-device-pixel-ratio: 2/1), not screen and ( min-device-pixel-ratio: 2), not screen and ( min-resolution: 192dpi), not screen and ( min-resolution: 2dppx) { - span.emoji { - margin-right: 5px; + html:not(.is-safari) { + span.emoji { + margin-right: 5px; + } + + avatar-element span.emoji { + margin-right: 0; + } } }