RoleColorEverywhere: Wrap roleGroupColor in ErrorBoundary
This commit is contained in:
parent
b0d37c981e
commit
992533245b
1 changed files with 3 additions and 2 deletions
|
@ -17,6 +17,7 @@
|
|||
*/
|
||||
|
||||
import { definePluginSettings } from "@api/Settings";
|
||||
import ErrorBoundary from "@components/ErrorBoundary";
|
||||
import { Devs } from "@utils/constants";
|
||||
import definePlugin, { OptionType } from "@utils/types";
|
||||
import { ChannelStore, GuildMemberStore, GuildStore } from "@webpack/common";
|
||||
|
@ -112,7 +113,7 @@ export default definePlugin({
|
|||
return colorString && parseInt(colorString.slice(1), 16);
|
||||
},
|
||||
|
||||
roleGroupColor({ id, count, title, guildId, label }: { id: string; count: number; title: string; guildId: string; label: string; }) {
|
||||
roleGroupColor: ErrorBoundary.wrap(({ id, count, title, guildId, label }: { id: string; count: number; title: string; guildId: string; label: string; }) => {
|
||||
const guild = GuildStore.getGuild(guildId);
|
||||
const role = guild?.roles[id];
|
||||
|
||||
|
@ -125,7 +126,7 @@ export default definePlugin({
|
|||
{title ?? label} — {count}
|
||||
</span>
|
||||
);
|
||||
},
|
||||
}, { noop: true }),
|
||||
|
||||
getVoiceProps({ user: { id: userId }, guildId }: { user: { id: string; }; guildId: string; }) {
|
||||
return {
|
||||
|
|
Loading…
Reference in a new issue