UserPFP: Dont set animated if not from img repo
This commit is contained in:
parent
a75c31773e
commit
da11b4ee27
1 changed files with 7 additions and 4 deletions
|
|
@ -20,13 +20,14 @@ import { openInviteModal } from "@utils/discord";
|
|||
import definePlugin, { OptionType } from "@utils/types";
|
||||
import { User } from "@vencord/discord-types";
|
||||
import { extractAndLoadChunksLazy } from "@webpack";
|
||||
import { IconUtils, Menu, openModal,UserStore } from "@webpack/common";
|
||||
import { IconUtils, Menu, openModal, UserStore } from "@webpack/common";
|
||||
|
||||
import { SetAvatarModal } from "./AvatarModal";
|
||||
|
||||
const cl = classNameFactory("vc-userpfp-");
|
||||
const DONO_URL = "https://ko-fi.com/coolesding";
|
||||
const INVITE_LINK = "userpfp-1129784704267210844";
|
||||
const USERPFP_IMG_URL = "https://raw.githubusercontent.com/UserPFP/img";
|
||||
|
||||
export const requireSettingsModal = extractAndLoadChunksLazy(['type:"USER_SETTINGS_MODAL_OPEN"']);
|
||||
export const KEY_DATASTORE = "vencord-custom-avatars";
|
||||
|
|
@ -135,9 +136,11 @@ export default definePlugin({
|
|||
|
||||
try {
|
||||
const res = new URL(avatarUrl);
|
||||
res.searchParams.set("animated", animated ? "true" : "false");
|
||||
if (!animated) {
|
||||
res.pathname = res.pathname.replaceAll(/\.gifv?/g, ".png");
|
||||
if (avatarUrl.startsWith(USERPFP_IMG_URL)) {
|
||||
res.searchParams.set("animated", animated ? "true" : "false");
|
||||
if (!animated) {
|
||||
res.pathname = res.pathname.replaceAll(/\.gifv?/g, ".png");
|
||||
}
|
||||
}
|
||||
return res.toString();
|
||||
} catch {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue