diff --git a/src/equicordplugins/zipPreview/index.tsx b/src/equicordplugins/zipPreview/index.tsx index b8a05c0a4..4addd95ab 100644 --- a/src/equicordplugins/zipPreview/index.tsx +++ b/src/equicordplugins/zipPreview/index.tsx @@ -114,18 +114,17 @@ const blobCache = new Map(); // Component to render inside each zip attachment function ZipAttachmentPreview({ attachment }: { attachment: any; }) { + const key = attachment?.id || attachment?.url || attachment?.proxy_url; const ext = attachment.fileName.match(/\.tar\.\w+$|(\.\w+)$/)?.[0] ?? ""; if (ext !== ".zip") return; - const [blob, setBlob] = useState(() => blobCache.get(attachment.id) || null); + const [blob, setBlob] = useState(() => blobCache.get(key) || null); const [error, setError] = useState(null); - const [expanded, setExpanded] = useState(() => { - try { return expandedState.get(attachment.id) ?? false; } catch { return false; } - }); + const [expanded, setExpanded] = useState(() => expandedState.get(key) ?? false); useEffect(() => { // If already cached, skip fetch - if (blobCache.has(attachment.id)) return; + if (blobCache.has(key)) return; let mounted = true; (async () => { @@ -143,14 +142,15 @@ function ZipAttachmentPreview({ attachment }: { attachment: any; }) { } if (mounted) { setBlob(b); - blobCache.set(attachment.id, b); + blobCache.set(key, b); } - } catch (err) { + } catch { if (mounted) setError("Failed to fetch archive"); } })(); + return () => { mounted = false; }; - }, [attachment.id]); + }, [key]); if (error) return
{error}
; if (!blob) return
Loading preview…
; @@ -161,7 +161,10 @@ function ZipAttachmentPreview({ attachment }: { attachment: any; }) { blob={blob} name={attachment.filename || attachment.name || "archive.zip"} expanded={expanded} - onExpandedChange={v => { setExpanded(v); expandedState.set(attachment.id, v); }} + onExpandedChange={v => { + setExpanded(v); + expandedState.set(key, v); + }} /> ); diff --git a/src/plugins/_api/badges/index.tsx b/src/plugins/_api/badges/index.tsx index 290bf4c44..cb54ac73a 100644 --- a/src/plugins/_api/badges/index.tsx +++ b/src/plugins/_api/badges/index.tsx @@ -48,7 +48,13 @@ const EquicordContributorBadge: ProfileBadge = { image: EQUICORD_CONTRIBUTOR_BADGE, position: BadgePosition.START, shouldShow: ({ userId }) => shouldShowEquicordContributorBadge(userId), - onClick: (_, { userId }) => openContributorModal(UserStore.getUser(userId)) + onClick: (_, { userId }) => openContributorModal(UserStore.getUser(userId)), + props: { + style: { + borderRadius: "50%", + transform: "scale(0.9)" + } + }, }; const EquicordDonorBadge: ProfileBadge = { diff --git a/src/plugins/reviewDB/index.tsx b/src/plugins/reviewDB/index.tsx index 548a476d1..6a38fa69e 100644 --- a/src/plugins/reviewDB/index.tsx +++ b/src/plugins/reviewDB/index.tsx @@ -85,9 +85,9 @@ export default definePlugin({ } }, { - find: ".SIDEBAR,shouldShowTooltip:", + find: '"UserProfileSidebar"', replacement: { - match: /children:\[(?=[^[]+?shouldShowTooltip:)/, + match: /children:\[(?=[^[]+?\.SIDEBAR)/, replace: "$&$self.BiteSizeReviewsButton({user:arguments[0].user})," } } diff --git a/src/webpack/common/components.ts b/src/webpack/common/components.ts index 1c5c4c02b..aa5c3626e 100644 --- a/src/webpack/common/components.ts +++ b/src/webpack/common/components.ts @@ -19,7 +19,7 @@ import { FormSwitchCompat } from "@components/FormSwitch"; import { LazyComponent } from "@utils/lazyReact"; import * as t from "@vencord/discord-types"; -import { filters, find, LazyComponentWebpack, mapMangledModuleLazy, waitFor } from "@webpack"; +import { filters, mapMangledModuleLazy, waitFor } from "@webpack"; import { FormText } from "./FormText"; import { waitForComponent } from "./internal"; @@ -56,15 +56,7 @@ export const TextInput = waitForComponent("TextInput", filters.comp export const TextArea = waitForComponent("TextArea", filters.componentByCode("this.getPaddingRight()},id:")); export const Text = waitForComponent("Text", filters.componentByCode('case"always-white"')); export const Heading = waitForComponent("Heading", filters.componentByCode(">6?{", "variant:")); -export const Select: t.Select = LazyComponentWebpack(() => { - const oldFilter = filters.componentByCode('="bottom",', ".select,", '"Escape"==='); - const newFilter = filters.componentByCode('"Select"', ".newOptionLabel"); - - const res = find(oldFilter) ?? find(newFilter); - if (res) return res; - - throw new Error("Vencord failed to find the Select component"); -}); +export const Select = waitForComponent("Select", filters.componentByCode('"Select"', ".newOptionLabel")); export const SearchableSelect = waitForComponent("SearchableSelect", filters.componentByCode('"SearchableSelect"')); export const Slider = waitForComponent("Slider", filters.componentByCode('"markDash".concat(')); export const Popout = waitForComponent("Popout", filters.componentByCode("ref:this.ref,", "renderPopout:this.renderPopout,"));