Browse Source

Upload avatar fix

Name in reply
master
morethanwords 4 years ago
parent
commit
6fd10adaef
  1. 7
      src/components/popupAvatar.ts
  2. 2
      src/lib/appManagers/appImManager.ts
  3. 5
      src/lib/mediaPlayer.ts

7
src/components/popupAvatar.ts

@ -1,4 +1,5 @@ @@ -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 { @@ -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);
});
}

2
src/lib/appManagers/appImManager.ts

@ -2610,7 +2610,7 @@ export class AppImManager { @@ -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);

5
src/lib/mediaPlayer.ts

@ -1,4 +1,5 @@ @@ -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 { @@ -369,7 +370,9 @@ export default class VideoPlayer {
});
video.addEventListener('click', () => {
this.togglePlay();
if(!touchSupport) {
this.togglePlay();
}
});
/* player.addEventListener('click', (e) => {

Loading…
Cancel
Save