Fix refreshing webPage media

This commit is contained in:
morethanwords 2021-10-23 02:23:31 +04:00
parent 409f30d806
commit 5c28ad6e20
2 changed files with 6 additions and 8 deletions

View File

@ -1548,12 +1548,12 @@ export default class ChatBubbles {
({rect}) => { ({rect}) => {
let height = windowSize.windowH; let height = windowSize.windowH;
height -= this.chat.topbar.container.getBoundingClientRect().height; height -= this.chat.topbar.container.getBoundingClientRect().height;
height -= 78; height -= mediaSizes.isMobile ? 58 : 78; // TODO: change height to mobile when ESG is bottom
return height; return height;
const rowsWrapperHeight = this.chat.input.rowsWrapper.getBoundingClientRect().height; /* const rowsWrapperHeight = this.chat.input.rowsWrapper.getBoundingClientRect().height;
const diff = rowsWrapperHeight - 54; const diff = rowsWrapperHeight - 54;
return rect.height + diff; return rect.height + diff; */
} }
); );
} }

View File

@ -44,11 +44,9 @@ export class AppWebPagesManager {
const {id} = apiWebPage; const {id} = apiWebPage;
const oldWebPage = this.webpages[id]; const oldWebPage = this.webpages[id];
if(oldWebPage && const isUpdated = oldWebPage &&
oldWebPage._ === apiWebPage._ && oldWebPage._ === apiWebPage._ &&
(oldWebPage as WebPage.webPage).hash === (oldWebPage as WebPage.webPage).hash) { (oldWebPage as WebPage.webPage).hash === (oldWebPage as WebPage.webPage).hash;
return oldWebPage;
}
if(apiWebPage._ === 'webPage') { if(apiWebPage._ === 'webPage') {
if(apiWebPage.photo?._ === 'photo') { if(apiWebPage.photo?._ === 'photo') {
@ -110,7 +108,7 @@ export class AppWebPagesManager {
safeReplaceObject(oldWebPage, apiWebPage); safeReplaceObject(oldWebPage, apiWebPage);
} }
if(!messageKey && pendingSet !== undefined) { if(!messageKey && pendingSet !== undefined && isUpdated) {
const msgs: {peerId: PeerId, mid: number, isScheduled: boolean}[] = []; const msgs: {peerId: PeerId, mid: number, isScheduled: boolean}[] = [];
pendingSet.forEach((value) => { pendingSet.forEach((value) => {
const [peerId, mid, isScheduled] = value.split('_'); const [peerId, mid, isScheduled] = value.split('_');