Fix ViewIcons
This commit is contained in:
parent
9cf88d4232
commit
098da8c3fd
1 changed files with 7 additions and 5 deletions
|
@ -65,7 +65,9 @@ const settings = definePluginSettings({
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
function openImage(url: string) {
|
function openImage(url?: string) {
|
||||||
|
if (!url) return;
|
||||||
|
|
||||||
const format = url.startsWith("/") ? "png" : settings.store.format;
|
const format = url.startsWith("/") ? "png" : settings.store.format;
|
||||||
|
|
||||||
const u = new URL(url, window.location.href);
|
const u = new URL(url, window.location.href);
|
||||||
|
@ -171,12 +173,12 @@ export default definePlugin({
|
||||||
},
|
},
|
||||||
|
|
||||||
patches: [
|
patches: [
|
||||||
// Make pfps clickable
|
// Make pfps clickable and add pointer cursor
|
||||||
{
|
{
|
||||||
find: "onAddFriend:function",
|
find: ".AVATAR_DECORATION_STATUS_ROUND_16;",
|
||||||
replacement: {
|
replacement: {
|
||||||
match: /\{src:(\i)(?=,avatarDecoration)/,
|
match: /memo\(.{0,50}(?=let{statusColor:\i,status:\i,...\i}=(\i),)/,
|
||||||
replace: "{src:$1,onClick:()=>$self.openImage($1)"
|
replace: (m, props) => `${m}${props}.onClick=()=>$self.openImage(${props}.src);${props}.style={cursor:${props}.src?"pointer":void 0};`
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// Make banners clickable
|
// Make banners clickable
|
||||||
|
|
Loading…
Reference in a new issue