fix plain folder icon

This commit is contained in:
sadan 2026-01-23 15:49:00 -05:00
parent 8dd799a89c
commit 1dcf7db52a
No known key found for this signature in database

View file

@ -28,12 +28,17 @@ export default definePlugin({
patches: [
{
find: ".folderPreviewGuildIconError",
find: "#{intl::GUILD_FOLDER_TOOLTIP_A11Y_LABEL}",
replacement: [
{
// Discord always renders both plain and guild icons folders and uses a css transtion to switch between them
match: /(?<=.folderButtonContent]:(!\i))/,
replace: (_, hasFolderButtonContentClass) => `,"vc-plainFolderIcon-plain":${hasFolderButtonContentClass}`
// let {hovered: h, sorting: s} = props;
// hasFolderButtonContent = h && s;
// ...
// className: cn({[_1]: hasFolderButtonContent, [_2]: !hasFolderButtonContent}),
// children: [!hasFolderButtonContent && ...]
match: /className:\i\(\)\(\{\[\i\.\i\]:(\i),\[\i\.\i\]:!\1(?=.{0,30}children:\[!\i&&)/,
replace: (m, hasFolderButtonContent) => `${m},"vc-plainFolderIcon-plain":${hasFolderButtonContent}`
}
]