Fix saving recent search
This commit is contained in:
parent
5dfe2e5a45
commit
fe8a54ea62
@ -173,7 +173,9 @@ export class AppSidebarLeft extends SidebarSlider {
|
|||||||
const scrollable = new Scrollable(searchContainer);
|
const scrollable = new Scrollable(searchContainer);
|
||||||
|
|
||||||
const close = () => {
|
const close = () => {
|
||||||
this.backBtn.click();
|
//setTimeout(() => {
|
||||||
|
this.backBtn.click();
|
||||||
|
//}, 0);
|
||||||
};
|
};
|
||||||
|
|
||||||
this.searchGroups = {
|
this.searchGroups = {
|
||||||
@ -360,7 +362,7 @@ export class AppSidebarLeft extends SidebarSlider {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
searchSuper.tabs.inputMessagesFilterEmpty.addEventListener('click', (e) => {
|
searchSuper.tabs.inputMessagesFilterEmpty.addEventListener('mousedown', (e) => {
|
||||||
const target = findUpTag(e.target, 'LI') as HTMLElement;
|
const target = findUpTag(e.target, 'LI') as HTMLElement;
|
||||||
if(!target) {
|
if(!target) {
|
||||||
return;
|
return;
|
||||||
|
@ -36,7 +36,7 @@ export class AppInlineBotsManager {
|
|||||||
result.rDescription = RichTextProcessor.wrapRichText(result.description, {noLinebreaks: true, noLinks: true});
|
result.rDescription = RichTextProcessor.wrapRichText(result.description, {noLinebreaks: true, noLinks: true});
|
||||||
result.initials = ((result as botInlineResult).url || result.title || result.type || '').substr(0, 1); */
|
result.initials = ((result as botInlineResult).url || result.title || result.type || '').substr(0, 1); */
|
||||||
|
|
||||||
if(result._ == 'botInlineMediaResult') {
|
if(result._ === 'botInlineMediaResult') {
|
||||||
if(result.document) {
|
if(result.document) {
|
||||||
result.document = appDocsManager.saveDoc(result.document);
|
result.document = appDocsManager.saveDoc(result.document);
|
||||||
}
|
}
|
||||||
|
@ -2188,6 +2188,11 @@ export class AppMessagesManager {
|
|||||||
} else {
|
} else {
|
||||||
message.media.photo = appPhotosManager.savePhoto(message.media.photo, mediaContext);
|
message.media.photo = appPhotosManager.savePhoto(message.media.photo, mediaContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!message.media.photo) { // * found this bug on test DC
|
||||||
|
delete message.media;
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 'messageMediaPoll':
|
case 'messageMediaPoll':
|
||||||
message.media.poll = appPollsManager.savePoll(message.media.poll, message.media.results);
|
message.media.poll = appPollsManager.savePoll(message.media.poll, message.media.results);
|
||||||
|
@ -49,9 +49,9 @@ export class AppPhotosManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public savePhoto(photo: Photo, context?: ReferenceContext) {
|
public savePhoto(photo: Photo, context?: ReferenceContext) {
|
||||||
if(photo._ == 'photoEmpty') return undefined;
|
if(photo._ === 'photoEmpty') return undefined;
|
||||||
|
|
||||||
/* if(photo.id == TEST_FILE_REFERENCE) {
|
/* if(photo.id === TEST_FILE_REFERENCE) {
|
||||||
console.warn('Testing FILE_REFERENCE_EXPIRED');
|
console.warn('Testing FILE_REFERENCE_EXPIRED');
|
||||||
const bytes = [2, 67, 175, 43, 190, 0, 0, 20, 62, 95, 111, 33, 45, 99, 220, 116, 218, 11, 167, 127, 213, 18, 127, 32, 243, 202, 117, 80, 30];
|
const bytes = [2, 67, 175, 43, 190, 0, 0, 20, 62, 95, 111, 33, 45, 99, 220, 116, 218, 11, 167, 127, 213, 18, 127, 32, 243, 202, 117, 80, 30];
|
||||||
//photo.file_reference = new Uint8Array(bytes);
|
//photo.file_reference = new Uint8Array(bytes);
|
||||||
@ -69,7 +69,7 @@ export class AppPhotosManager {
|
|||||||
|
|
||||||
if(photo.sizes?.length) {
|
if(photo.sizes?.length) {
|
||||||
const size = photo.sizes[photo.sizes.length - 1];
|
const size = photo.sizes[photo.sizes.length - 1];
|
||||||
if(size._ == 'photoSizeProgressive') {
|
if(size._ === 'photoSizeProgressive') {
|
||||||
size.size = size.sizes[size.sizes.length - 1];
|
size.size = size.sizes[size.sizes.length - 1];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -379,7 +379,7 @@ export class AppPhotosManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const location: InputFileLocation.inputDocumentFileLocation | InputFileLocation.inputPhotoFileLocation = {
|
const location: InputFileLocation.inputDocumentFileLocation | InputFileLocation.inputPhotoFileLocation = {
|
||||||
_: photo._ == 'document' ? 'inputDocumentFileLocation' : 'inputPhotoFileLocation',
|
_: photo._ === 'document' ? 'inputDocumentFileLocation' : 'inputPhotoFileLocation',
|
||||||
id: photo.id,
|
id: photo.id,
|
||||||
access_hash: photo.access_hash,
|
access_hash: photo.access_hash,
|
||||||
file_reference: photo.file_reference,
|
file_reference: photo.file_reference,
|
||||||
|
@ -608,17 +608,19 @@ export class AppUsersManager {
|
|||||||
limit: 30,
|
limit: 30,
|
||||||
hash: 0,
|
hash: 0,
|
||||||
}).then((result) => {
|
}).then((result) => {
|
||||||
let peerIds: number[];
|
let peerIds: number[] = [];
|
||||||
if(result._ === 'contacts.topPeers') {
|
if(result._ === 'contacts.topPeers') {
|
||||||
//console.log(result);
|
//console.log(result);
|
||||||
this.saveApiUsers(result.users);
|
this.saveApiUsers(result.users);
|
||||||
appChatsManager.saveApiChats(result.chats);
|
appChatsManager.saveApiChats(result.chats);
|
||||||
|
|
||||||
peerIds = result.categories[0].peers.map((topPeer) => {
|
if(result.categories.length) {
|
||||||
const peerId = appPeersManager.getPeerId(topPeer.peer);
|
peerIds = result.categories[0].peers.map((topPeer) => {
|
||||||
appStateManager.setPeer(peerId, this.getUser(peerId));
|
const peerId = appPeersManager.getPeerId(topPeer.peer);
|
||||||
return peerId;
|
appStateManager.setPeer(peerId, this.getUser(peerId));
|
||||||
});
|
return peerId;
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
appStateManager.pushToState('topPeers', peerIds);
|
appStateManager.pushToState('topPeers', peerIds);
|
||||||
|
@ -206,7 +206,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.input-field {
|
.input-field {
|
||||||
text-align: center;
|
text-align: initial;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user