Skip to content
This repository has been archived by the owner on Jul 29, 2024. It is now read-only.

Commit

Permalink
Add double counter verification to command palette
Browse files Browse the repository at this point in the history
  • Loading branch information
verticalsync committed Feb 5, 2024
1 parent 7ff0634 commit 0b7a20b
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
12 changes: 12 additions & 0 deletions src/components/VencordSettings/UpdaterTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,17 @@ import { SettingsTab, wrapTab } from "./shared";

function withDispatcher(dispatcher: React.Dispatch<React.SetStateAction<boolean>>, action: () => any) {
return async () => {
console.log("a1");
dispatcher(true);
console.log("b1");
try {
console.log("c1");
await action();
console.log("d1");
} catch (e: any) {
console.log("e1");
UpdateLogger.error("Failed to update", e);
console.log("f1");
if (!e) {
var err = "An unknown error occurred (error is undefined).\nPlease try again.";
} else if (e.code && e.cmd) {
Expand Down Expand Up @@ -151,11 +157,17 @@ function Updatable(props: CommonProps) {
size={Button.Sizes.SMALL}
disabled={isUpdating || isChecking}
onClick={withDispatcher(setIsChecking, async () => {
console.log("1");
const outdated = await checkForUpdates();
console.log("2");
if (outdated) {
console.log("3");
setUpdates(changes);
console.log("4");
} else {
console.log("5");
setUpdates([]);
console.log("6");
Toasts.show({
message: "No updates found!",
id: Toasts.genId(),
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/commandPalette/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ export default definePlugin({
registerAction({
id: "openDevSettings",
label: "Open Dev tab",
callback: () => SettingsRouter.open("VencordPatchHelper"),
registrar: "Vencord"
callback: () => SettingsRouter.open("SuncordPatchHelper"),
registrar: "Suncord"
});
}
},
Expand Down
15 changes: 15 additions & 0 deletions src/plugins/doubleCounterVerifyBypass/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ import { SuncordDevs } from "@utils/constants";
import definePlugin from "@utils/types";
import { Alerts, Menu } from "@webpack/common";
import { Message } from "discord-types/general";
import { registerAction } from "plugins/commandPalette/commands";
import { openSimpleTextInput } from "plugins/commandPalette/components/TextInput";
import { Settings } from "Vencord";

const DOUBLECOUNTER_APP_ID = "703886990948565003";
const VERIFICATION_COMPONENT_ID = "verification_panel:verify";
Expand Down Expand Up @@ -69,6 +72,18 @@ export default definePlugin({

start() {
addContextMenuPatch("message", patchMessageContextMenu);

if (Settings.plugins.CommandPalette.enabled) {
registerAction({
id: "doubleCounterVerify",
label: "Verify a Double Counter Link",
callback: async () => {
const link = await openSimpleTextInput("Please enter the Double Counter link you want to verify.");
if (link) verify(link);
},
registrar: "DoubleCounterVerifyBypass"
});
}
},

stop() {
Expand Down

0 comments on commit 0b7a20b

Please sign in to comment.