mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-07 13:43:03 -04:00
Merge remote-tracking branch 'upstream/dev' into dev
This commit is contained in:
commit
bbcc27a55e
7 changed files with 23 additions and 13 deletions
|
@ -21,6 +21,7 @@ import { definePluginSettings } from "@api/Settings";
|
||||||
import { makeRange } from "@components/PluginSettings/components";
|
import { makeRange } from "@components/PluginSettings/components";
|
||||||
import { debounce } from "@shared/debounce";
|
import { debounce } from "@shared/debounce";
|
||||||
import { Devs } from "@utils/constants";
|
import { Devs } from "@utils/constants";
|
||||||
|
import { Logger } from "@utils/Logger";
|
||||||
import definePlugin, { OptionType } from "@utils/types";
|
import definePlugin, { OptionType } from "@utils/types";
|
||||||
import { Menu, ReactDOM } from "@webpack/common";
|
import { Menu, ReactDOM } from "@webpack/common";
|
||||||
import { JSX } from "react";
|
import { JSX } from "react";
|
||||||
|
@ -237,12 +238,16 @@ export default definePlugin({
|
||||||
},
|
},
|
||||||
|
|
||||||
renderMagnifier(instance) {
|
renderMagnifier(instance) {
|
||||||
if (instance.props.id === ELEMENT_ID) {
|
try {
|
||||||
if (!this.currentMagnifierElement) {
|
if (instance.props.id === ELEMENT_ID) {
|
||||||
this.currentMagnifierElement = <Magnifier size={settings.store.size} zoom={settings.store.zoom} instance={instance} />;
|
if (!this.currentMagnifierElement) {
|
||||||
this.root = ReactDOM.createRoot(this.element!);
|
this.currentMagnifierElement = <Magnifier size={settings.store.size} zoom={settings.store.zoom} instance={instance} />;
|
||||||
this.root.render(this.currentMagnifierElement);
|
this.root = ReactDOM.createRoot(this.element!);
|
||||||
|
this.root.render(this.currentMagnifierElement);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} catch (error) {
|
||||||
|
new Logger("ImageZoom").error("Failed to render magnifier:", error);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
.vc-mutual-gdms-tab-bar {
|
.vc-mutual-gdms-tab-bar {
|
||||||
gap: 0;
|
gap: 0;
|
||||||
justify-content: space-between;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,7 @@ import { Guild, User } from "discord-types/general";
|
||||||
import { settings } from ".";
|
import { settings } from ".";
|
||||||
|
|
||||||
const IconClasses = findByPropsLazy("icon", "acronym", "childWrapper");
|
const IconClasses = findByPropsLazy("icon", "acronym", "childWrapper");
|
||||||
const FriendRow = findComponentByCodeLazy(".listName,discriminatorClass");
|
const FriendRow = findComponentByCodeLazy("discriminatorClass:", ".isMobileOnline", "getAvatarURL");
|
||||||
|
|
||||||
const cl = classNameFactory("vc-gp-");
|
const cl = classNameFactory("vc-gp-");
|
||||||
|
|
||||||
|
|
|
@ -50,8 +50,6 @@
|
||||||
border-bottom: 2px solid transparent;
|
border-bottom: 2px solid transparent;
|
||||||
color: var(--interactive-normal);
|
color: var(--interactive-normal);
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
height: 39px;
|
|
||||||
margin-right: -10px;
|
|
||||||
line-height: 14px;
|
line-height: 14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -54,9 +54,10 @@ export default definePlugin({
|
||||||
authors: [Devs.Rini, Devs.TheKodeToad],
|
authors: [Devs.Rini, Devs.TheKodeToad],
|
||||||
patches: [
|
patches: [
|
||||||
{
|
{
|
||||||
find: '?"@":""',
|
find: '"BaseUsername"',
|
||||||
replacement: {
|
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])"
|
replace: "$self.renderUsername(arguments[0])"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -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
|
// Add back Copy & Save Image
|
||||||
{
|
{
|
||||||
find: 'id:"copy-image"',
|
find: 'id:"copy-image"',
|
||||||
|
@ -141,7 +148,7 @@ export default definePlugin({
|
||||||
replace: "false"
|
replace: "false"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
match: /return\s*?\[\i\.\i\.canCopyImage\(\)/,
|
match: /return\s*?\[.{0,50}?(?=\?.{0,100}?id:"copy-image")/,
|
||||||
replace: "return [true"
|
replace: "return [true"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -27,7 +27,7 @@ export let useRef: typeof React.useRef;
|
||||||
export let useReducer: typeof React.useReducer;
|
export let useReducer: typeof React.useReducer;
|
||||||
export let useCallback: typeof React.useCallback;
|
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 => {
|
waitFor("useState", m => {
|
||||||
React = m;
|
React = m;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue