Fix paused pip on peer changing
Fix revealing spoiler in media viewer
This commit is contained in:
parent
73a2d20712
commit
b8c715638e
@ -7,6 +7,7 @@
|
||||
import MEDIA_MIME_TYPES_SUPPORTED from "../environment/mediaMimeTypesSupport";
|
||||
import cancelEvent from "../helpers/dom/cancelEvent";
|
||||
import { attachClickEvent, detachClickEvent } from "../helpers/dom/clickEvent";
|
||||
import findUpClassName from "../helpers/dom/findUpClassName";
|
||||
import findUpTag from "../helpers/dom/findUpTag";
|
||||
import setInnerHTML from "../helpers/dom/setInnerHTML";
|
||||
import mediaSizes from "../helpers/mediaSizes";
|
||||
@ -131,7 +132,8 @@ export default class AppMediaViewer extends AppMediaViewerBase<'caption', 'delet
|
||||
|
||||
const onCaptionClick = (e: MouseEvent) => {
|
||||
const a = findUpTag(e.target, 'A');
|
||||
if(a instanceof HTMLAnchorElement) { // close viewer if it's t.me/ redirect
|
||||
const spoiler = findUpClassName(e.target, 'spoiler');
|
||||
if(a instanceof HTMLAnchorElement && (!spoiler || this.content.caption.classList.contains('is-spoiler-visible'))) { // close viewer if it's t.me/ redirect
|
||||
const onclick = a.getAttribute('onclick');
|
||||
if(!onclick || onclick.includes('showMaskedAlert')) {
|
||||
return;
|
||||
|
@ -7,7 +7,7 @@
|
||||
import type { ChatRights } from "../../lib/appManagers/appChatsManager";
|
||||
import type { AppImManager } from "../../lib/appManagers/appImManager";
|
||||
import type { MessagesStorageKey } from "../../lib/appManagers/appMessagesManager";
|
||||
import type AppMediaViewerBase from "../appMediaViewerBase";
|
||||
// import type AppMediaViewerBase from "../appMediaViewerBase";
|
||||
import EventListenerBase from "../../helpers/eventListenerBase";
|
||||
import { logger, LogTypes } from "../../lib/logger";
|
||||
import rootScope from "../../lib/rootScope";
|
||||
@ -439,10 +439,10 @@ export default class Chat extends EventListenerBase<{
|
||||
this.inited = true;
|
||||
}
|
||||
|
||||
const appMediaViewer = (window as any).appMediaViewer as AppMediaViewerBase<any, any, any>;
|
||||
if(appMediaViewer) {
|
||||
appMediaViewer.close();
|
||||
}
|
||||
// const appMediaViewer = (window as any).appMediaViewer as AppMediaViewerBase<any, any, any>;
|
||||
// if(appMediaViewer) {
|
||||
// appMediaViewer.close();
|
||||
// }
|
||||
|
||||
const samePeer = this.peerId === peerId;
|
||||
if(!samePeer) {
|
||||
|
Loading…
Reference in New Issue
Block a user