Skip to content

Commit

Permalink
fix profile crash for badges and change tweak loader might break
Browse files Browse the repository at this point in the history
  • Loading branch information
byeoon committed May 23, 2024
1 parent 1ba9218 commit b77ae82
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 35 deletions.
2 changes: 2 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{
}
14 changes: 7 additions & 7 deletions dist/vendetta.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import initFixes from "@lib/fixes";
import { patchBadges } from "@/lib/badge/badges";
import logger from "@lib/logger";
import windowObject from "@lib/windowObject";
import { initTweaks } from "./lib/tweak";
import loadTweaks from "./lib/tweak";
import { initCustomCommands } from "./lib/command";

export default async () => {
Expand All @@ -32,7 +32,7 @@ export default async () => {
}

unloads.push(await initPlugins());
unloads.push(await initTweaks());
unloads.push(await loadTweaks());
unloads.push(await initCustomCommands());
unloads.push(await patchBadges());
logger.log("Opti has loaded!");
Expand Down
6 changes: 1 addition & 5 deletions src/lib/badge/badges.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
export function patchBadges()
{
// here lies the attempts to make badges by using the following implomentation methods:
// aliucord
// enmity
// 2x 3rd party plugins
console.log("Badge component failed to load since it is not implomented yet.");
console.log("Badge component failed to load since it is not PROPERLY implomented yet.");
}
27 changes: 9 additions & 18 deletions src/lib/badge/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,7 @@ export function loadBadges() {
if (value?.dev) {
pushBadge({
name: "MemoryLeak Dev",
image: "",
custom: <Badges.bdDevs />
image: ""
});
}
break;
Expand Down Expand Up @@ -147,57 +146,49 @@ export function loadBadges() {
if (value?.developer) {
pushBadge({
name: "Replugged Developer",
image: "",
custom: <Badges.Developer color={colors} />
image: ""
});
}
if (value?.staff) {
pushBadge({
name: "Replugged Staff",
image: "",
custom: <Badges.Staff color={colors} />
image: ""
});
}
if (value?.support) {
pushBadge({
name: "Replugged Support",
image: "",
custom: <Badges.Support color={colors} />
image: ""
});
}
if (value?.contributor) {
pushBadge({
name: "Replugged Contributor",
image: "",
custom: <Badges.Contributor color={colors} />
image: ""
});
}
if (value?.translator) {
pushBadge({
name: "Replugged Translator",
image: "",
custom: <Badges.Translator color={colors} />
image: ""
});
}
if (value?.hunter) {
pushBadge({
name: "Replugged Hunter",
image: "",
custom: <Badges.BugHunter color={colors} />
image: ""
});
}
if (value?.early) {
pushBadge({
name: "Replugged Early Access",
image: "",
custom: <Badges.EarlyUser color={colors} />
image: ""
});
}
if (value?.booster) {
pushBadge({
name: "Replugged Booster",
image: "",
custom: <Badges.Booster color={colors} />
image: ""
});
}
if (value?.custom?.name) {
Expand Down
2 changes: 2 additions & 0 deletions src/lib/badge/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export interface CustomBadges {
badge: string;
name: string;
customBadgesArray: {
badge: string;
name: string;
Expand Down
7 changes: 4 additions & 3 deletions src/lib/tweak.ts → src/lib/tweak/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ import { silentTyping, unloadSilentTyping } from "@/lib/tweak/silentTyping";
import { hideDumbButtons, unloadHideButtons } from "@/lib/tweak/HideDumbButtons";
import { trustURL, unloadTrustURL } from "@/lib/tweak/trustURL";
import { enableExperiments, unloadEnableExperiments } from "@/lib/tweak/enableExperiments";
import { removeDeletePrompt, unloadRemoveDelete } from "./tweak/removeDelete";
import { loadBadges } from "./badge/index";
export function initTweaks()
import { removeDeletePrompt, unloadRemoveDelete } from "./removeDelete";
import { loadBadges } from "../badge/index";

export default function loadTweaks()
{
//@ts-ignore
settings.tweaks ??= {};
Expand Down

0 comments on commit b77ae82

Please sign in to comment.