Browse Source

Fix original message time

Fix animated emoji sticker play after click and blur
master
Eduard Kuzmenko 4 years ago
parent
commit
42506be144
  1. 10
      src/components/chat/input.ts
  2. 2
      src/components/chat/messageRender.ts
  3. 1
      src/components/wrappers.ts

10
src/components/chat/input.ts

@ -503,7 +503,7 @@ export class ChatInput { @@ -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 { @@ -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;

2
src/components/chat/messageRender.ts

@ -40,7 +40,7 @@ export namespace MessageRender { @@ -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');

1
src/components/wrappers.ts

@ -674,6 +674,7 @@ export function wrapSticker({doc, div, middleware, lazyLoadQueue, group, play, o @@ -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();
}
});

Loading…
Cancel
Save