Merge remote-tracking branch 'upstream/dev' into dev

This commit is contained in:
thororen1234 2025-04-30 08:17:28 -04:00
commit bbcc27a55e
No known key found for this signature in database
7 changed files with 23 additions and 13 deletions

View file

@ -21,6 +21,7 @@ import { definePluginSettings } from "@api/Settings";
import { makeRange } from "@components/PluginSettings/components";
import { debounce } from "@shared/debounce";
import { Devs } from "@utils/constants";
import { Logger } from "@utils/Logger";
import definePlugin, { OptionType } from "@utils/types";
import { Menu, ReactDOM } from "@webpack/common";
import { JSX } from "react";
@ -237,6 +238,7 @@ export default definePlugin({
},
renderMagnifier(instance) {
try {
if (instance.props.id === ELEMENT_ID) {
if (!this.currentMagnifierElement) {
this.currentMagnifierElement = <Magnifier size={settings.store.size} zoom={settings.store.zoom} instance={instance} />;
@ -244,6 +246,9 @@ export default definePlugin({
this.root.render(this.currentMagnifierElement);
}
}
} catch (error) {
new Logger("ImageZoom").error("Failed to render magnifier:", error);
}
},
updateMagnifier(instance) {

View file

@ -1,4 +1,3 @@
.vc-mutual-gdms-tab-bar {
gap: 0;
justify-content: space-between;
}

View file

@ -18,7 +18,7 @@ import { Guild, User } from "discord-types/general";
import { settings } from ".";
const IconClasses = findByPropsLazy("icon", "acronym", "childWrapper");
const FriendRow = findComponentByCodeLazy(".listName,discriminatorClass");
const FriendRow = findComponentByCodeLazy("discriminatorClass:", ".isMobileOnline", "getAvatarURL");
const cl = classNameFactory("vc-gp-");

View file

@ -50,8 +50,6 @@
border-bottom: 2px solid transparent;
color: var(--interactive-normal);
cursor: pointer;
height: 39px;
margin-right: -10px;
line-height: 14px;
}

View file

@ -54,9 +54,10 @@ export default definePlugin({
authors: [Devs.Rini, Devs.TheKodeToad],
patches: [
{
find: '?"@":""',
find: '"BaseUsername"',
replacement: {
match: /(?<=onContextMenu:\i,children:)\i\+\i/,
/* TODO: remove \i+\i once change makes it to stable */
match: /(?<=onContextMenu:\i,children:)(?:\i\+\i|\i)/,
replace: "$self.renderUsername(arguments[0])"
}
},

View file

@ -131,6 +131,13 @@ export default definePlugin({
]
},
{
find: "Copy image not supported",
replacement: {
match: /(?<=(?:canSaveImage|canCopyImage)\(\i?\)\{.{0,50})!\i\.isPlatformEmbedded/g,
replace: "false"
}
},
// Add back Copy & Save Image
{
find: 'id:"copy-image"',
@ -141,7 +148,7 @@ export default definePlugin({
replace: "false"
},
{
match: /return\s*?\[\i\.\i\.canCopyImage\(\)/,
match: /return\s*?\[.{0,50}?(?=\?.{0,100}?id:"copy-image")/,
replace: "return [true"
},
{

View file

@ -27,7 +27,7 @@ export let useRef: typeof React.useRef;
export let useReducer: typeof React.useReducer;
export let useCallback: typeof React.useCallback;
export const ReactDOM: typeof import("react-dom") & typeof import("react-dom/client") = findByPropsLazy("createPortal", "render");
export const ReactDOM: typeof import("react-dom") & typeof import("react-dom/client") = findByPropsLazy("createPortal");
waitFor("useState", m => {
React = m;