From 6fd10adaef92193d46ac2ccc8f5169e82eddc7cb Mon Sep 17 00:00:00 2001 From: morethanwords Date: Sat, 29 Aug 2020 00:06:28 +0300 Subject: [PATCH] Upload avatar fix Name in reply --- src/components/popupAvatar.ts | 7 ++----- src/lib/appManagers/appImManager.ts | 2 +- src/lib/mediaPlayer.ts | 5 ++++- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/components/popupAvatar.ts b/src/components/popupAvatar.ts index 84b3322f..3c56934b 100644 --- a/src/components/popupAvatar.ts +++ b/src/components/popupAvatar.ts @@ -1,4 +1,5 @@ import resizeableImage from "../lib/cropper"; +import appDownloadManager from "../lib/appManagers/appDownloadManager"; export class PopupAvatar { private container = document.getElementById('popup-avatar'); @@ -76,11 +77,7 @@ export class PopupAvatar { private resolve() { this.onCrop(() => { - //return apiFileManager.uploadFile(this.blob); - return fetch('/upload', { - method: 'POST', - body: this.blob - }).then(res => res.json()); + return appDownloadManager.upload(this.blob); }); } diff --git a/src/lib/appManagers/appImManager.ts b/src/lib/appManagers/appImManager.ts index 02601f13..f8db0d04 100644 --- a/src/lib/appManagers/appImManager.ts +++ b/src/lib/appManagers/appImManager.ts @@ -2610,7 +2610,7 @@ export class AppImManager { } else { if(message.reply_to_mid) { let originalMessage = appMessagesManager.getMessage(message.reply_to_mid); - let originalPeerTitle = appPeersManager.getPeerTitle(originalMessage.fromID, true) || ''; + let originalPeerTitle = appPeersManager.getPeerTitle(originalMessage.fromID || originalMessage.fwdFromID, true) || ''; /////////this.log('message to render reply', originalMessage, originalPeerTitle, bubble, message); diff --git a/src/lib/mediaPlayer.ts b/src/lib/mediaPlayer.ts index 3c7e092e..adcca891 100644 --- a/src/lib/mediaPlayer.ts +++ b/src/lib/mediaPlayer.ts @@ -1,4 +1,5 @@ import { cancelEvent, whichChild } from "./utils"; +import { touchSupport } from "./config"; export class ProgressLine { public container: HTMLDivElement; @@ -369,7 +370,9 @@ export default class VideoPlayer { }); video.addEventListener('click', () => { - this.togglePlay(); + if(!touchSupport) { + this.togglePlay(); + } }); /* player.addEventListener('click', (e) => {