Skip to content

Commit

Permalink
Merge branch 'main' into waitForStoreName
Browse files Browse the repository at this point in the history
  • Loading branch information
yofukashino authored Jul 10, 2024
2 parents f08c8ec + 706d241 commit 52f92b5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ export const WEBLATE_URL = "https://i18n.replugged.dev";
export const WEBSITE_URL = "https://replugged.dev";
export const BETA_WEBSITE_URL = "https://beta.replugged.dev";
export const DISCORD_BLURPLE = "#7289da";
export const REPLUGGED_CLYDE_ID = "826980768571716968"; // "REPLUGGED" in ASCII codes
3 changes: 2 additions & 1 deletion src/renderer/apis/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import type { Store } from "../modules/common/flux";
import { Logger } from "../modules/logger";
import { filters, getByStoreName, waitForModule } from "../modules/webpack";
import icon from "../assets/logo.png";
import { REPLUGGED_CLYDE_ID } from "../../constants";
const logger = Logger.api("Commands");

let RepluggedUser: User | undefined;
Expand All @@ -29,7 +30,7 @@ interface CommandsAndSection {
void waitForModule<typeof User>(filters.bySource("hasHadPremium(){")).then((User) => {
RepluggedUser = new User({
avatar: "replugged",
id: "replugged",
id: REPLUGGED_CLYDE_ID,
bot: true,
username: "Replugged",
system: true,
Expand Down
3 changes: 2 additions & 1 deletion src/renderer/coremods/commands/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {

import { commandAndSections, defaultSection } from "../../apis/commands";
import { loadCommands, unloadCommands } from "./commands";
import { REPLUGGED_CLYDE_ID } from "../../../constants";

const logger = Logger.api("Commands");
const injector = new Injector();
Expand Down Expand Up @@ -293,7 +294,7 @@ async function injectProfileFetch(): Promise<void> {
);
const fetchProfileKey = getFunctionKeyBySource(mod, "fetchProfile")!;
injector.instead(mod, fetchProfileKey, (args, res) => {
if (args[0] === "replugged") {
if (args[0] === REPLUGGED_CLYDE_ID) {
return;
}
return res(...args);
Expand Down

0 comments on commit 52f92b5

Please sign in to comment.