mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-08 22:23:02 -04:00
fix plugins using the image modal (#3368)
This commit is contained in:
parent
64dadcce4c
commit
8ad33db6c2
5 changed files with 3 additions and 52 deletions
|
@ -16,7 +16,7 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { filters, findModuleId, mapMangledModuleLazy, proxyLazyWebpack, wreq } from "@webpack";
|
||||
import { filters, findByCodeLazy, mapMangledModuleLazy } from "@webpack";
|
||||
import type { ComponentType, PropsWithChildren, ReactNode, Ref } from "react";
|
||||
|
||||
import { LazyComponent } from "./react";
|
||||
|
@ -138,16 +138,10 @@ export type MediaModalProps = {
|
|||
fit?: string;
|
||||
shouldRedactExplicitContent?: boolean;
|
||||
shouldHideMediaOptions?: boolean;
|
||||
shouldAnimateCarousel?: boolean;
|
||||
};
|
||||
|
||||
export const openMediaModal: (props: MediaModalProps) => void = proxyLazyWebpack(() => {
|
||||
const mediaModalKeyModuleId = findModuleId('"Zoomed Media Modal"');
|
||||
if (mediaModalKeyModuleId == null) return;
|
||||
|
||||
const openMediaModalModule = wreq(findModuleId(mediaModalKeyModuleId, "modalKey:") as any);
|
||||
return Object.values<any>(openMediaModalModule).find(v => String(v).includes("modalKey:"));
|
||||
});
|
||||
// modal key: "Media Viewer Modal"
|
||||
export const openMediaModal: (props: MediaModalProps) => void = findByCodeLazy("hasMediaOptions", "shouldHideMediaOptions");
|
||||
|
||||
interface ModalAPI {
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue