From 42506be144c39562baa4fc3a6c7a47295ca39e07 Mon Sep 17 00:00:00 2001 From: Eduard Kuzmenko Date: Wed, 18 Nov 2020 22:07:31 +0200 Subject: [PATCH] Fix original message time Fix animated emoji sticker play after click and blur --- src/components/chat/input.ts | 10 +++++++--- src/components/chat/messageRender.ts | 2 +- src/components/wrappers.ts | 1 + 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/components/chat/input.ts b/src/components/chat/input.ts index 5d2d99a1..92a577bf 100644 --- a/src/components/chat/input.ts +++ b/src/components/chat/input.ts @@ -503,7 +503,7 @@ export class ChatInput { }; } - this.replyElements.cancelBtn.addEventListener('click', (e) => { + const onCancelHelper = (e: Event) => { cancelEvent(e); if(this.willSendWebPage) { @@ -521,10 +521,14 @@ export class ChatInput { this.clearHelper(); this.updateSendBtn(); - }); + }; + + this.replyElements.cancelBtn.addEventListener(isTouchSupported ? 'touchend' : 'click', onCancelHelper); let d = false; - this.replyElements.container.addEventListener('click', (e) => { + this.replyElements.container.addEventListener(isTouchSupported ? 'touchend' : 'click', (e) => { + cancelEvent(e); + if(!findUpClassName(e.target, 'reply-wrapper')) return; if(this.helperType == 'forward') { if(d) return; diff --git a/src/components/chat/messageRender.ts b/src/components/chat/messageRender.ts index 89ae47be..2777218d 100644 --- a/src/components/chat/messageRender.ts +++ b/src/components/chat/messageRender.ts @@ -40,7 +40,7 @@ export namespace MessageRender { } const title = getFullDate(date) - + (message.edit_date ? `\nEdited: ${getFullDate(new Date(message.edit_date * 1000))}` : ''); + + (message.edit_date ? `\nEdited: ${getFullDate(new Date(message.edit_date * 1000))}` : '') + (message.fwd_from ? `\nOriginal: ${getFullDate(new Date(message.fwd_from.date * 1000))}` : ''); const timeSpan = document.createElement('span'); diff --git a/src/components/wrappers.ts b/src/components/wrappers.ts index ec42e4ac..a69c6f07 100644 --- a/src/components/wrappers.ts +++ b/src/components/wrappers.ts @@ -674,6 +674,7 @@ export function wrapSticker({doc, div, middleware, lazyLoadQueue, group, play, o let animation = LottieLoader.getAnimation(div); if(animation.paused) { + animation.autoplay = true; animation.restart(); } });