Skip to content

Commit

Permalink
Copier Fix (#400)
Browse files Browse the repository at this point in the history
  • Loading branch information
zrodevkaan authored Apr 7, 2024
1 parent 96d1787 commit 9b0d166
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
18 changes: 5 additions & 13 deletions Copier/menus/dev.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,13 @@ export default function () {
const patches = new Set([]);

const patch = (res, props) => {
const handleClose = () => {
res?.props?.onClose();
};
const handleClose = () => res?.props?.onClose();

const role = props.role || (() => {
const guild = GuildStore.getGuild(SelectedGuildStore.getGuildId());
if (!guild) return handleClose();

const role = guild.getRole(props.id);

if (!role) return handleClose();

return role;
const selectedGuild = SelectedGuildStore.getGuildId();
if (!GuildStore.getGuild(selectedGuild)) return handleClose();
const role = GuildStore.getRole(selectedGuild, props.id);
return role || handleClose();
})();

const colors = {
Expand All @@ -73,8 +67,6 @@ export default function () {
rgb: int2rgb(role.color)
};

console.log(colors);

if (!Array.isArray(res.props.children)) {
res.props.children = [res.props.children];
}
Expand Down
2 changes: 1 addition & 1 deletion Copier/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"twitter_username": "Strencher3"
}
],
"version": "1.6.0",
"version": "1.6.1",
"description": "Allows you to copy certain stuff with custom options.",
"github": "https://github.com/Strencher/BetterDiscordStuff/blob/master/Copier/Copier.plugin.js",
"github_raw": "https://raw.githubusercontent.com/Strencher/BetterDiscordStuff/master/Copier/Copier.plugin.js",
Expand Down

0 comments on commit 9b0d166

Please sign in to comment.