Fix displaying private search results

Fix autodownloading files
Fix reporting messages
This commit is contained in:
Eduard Kuzmenko 2022-06-25 17:08:42 +04:00
parent f23d953c5a
commit 2aa743b8cc
5 changed files with 10 additions and 6 deletions

View File

@ -121,7 +121,7 @@ export default async function wrapDocument({message, withTime, fontWeight, voice
size: choosePhotoSize(doc, 54, 54, true),
managers
});
console.log('was wrapping photo', performance.now() - perf);
// console.log('was wrapping photo', performance.now() - perf);
icoDiv.style.width = icoDiv.style.height = '';
if(wrapped.images.thumb) imgs.push(wrapped.images.thumb);
if(wrapped.images.full) imgs.push(wrapped.images.full);

View File

@ -1965,7 +1965,7 @@ export class AppDialogsManager {
peerId,
});
// this.setLastMessage(ret.dialog, message, ret.dom, query);
this.setLastMessage({_: 'dialog', peerId} as any, message, ret.dom, query);
if(message.peerId !== peerId) {
ret.dom.listEl.dataset.peerId = '' + message.peerId;
@ -2060,7 +2060,7 @@ export class AppDialogsManager {
const li = document.createElement(DIALOG_LIST_ELEMENT_TAG);
li.classList.add('chatlist-chat');
(li as HTMLAnchorElement).href = '#' + peerId;
if(!autonomous) (li as HTMLAnchorElement).href = '#' + peerId;
if(rippleEnabled) {
ripple(li);
}

View File

@ -159,6 +159,10 @@ export class AppDownloadManager {
public downloadMedia(options: DownloadMediaOptions, type: DownloadType = 'blob'): DownloadBlob {
const {downloadOptions, fileName} = getDownloadMediaDetails(options);
if(fileName === 'document_5307720352468571676') {
debugger;
}
return this.d(fileName, () => {
const cb = type === 'url' ? this.managers.apiFileManager.downloadMediaURL : (type === 'void' ? this.managers.apiFileManager.downloadMediaVoid : this.managers.apiFileManager.downloadMedia);
return cb(options);

View File

@ -271,8 +271,8 @@ export class AppStickersManager extends AppManager {
]).then(([doc, a]) => {
return {
doc: doc,
animation: a.doc,
sound: a.sound
animation: a?.doc,
sound: a?.sound
};
});
}

View File

@ -613,7 +613,7 @@ export class ApiFileManager extends AppManager {
if(!promise) {
promise = this.download(downloadOptions);
if(isDocument) {
if(isDocument && !thumb) {
this.rootScope.dispatchEvent('document_downloading', media.id);
promise.catch(noop).finally(() => {
this.rootScope.dispatchEvent('document_downloaded', media.id);