Browse Source

Remove hard limit on discord appid length (#404)

master
Jeff 2 years ago
committed by GitHub
parent
commit
9b56984782
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      src/components/settings/ConfigPanels/ExternalConfig.tsx
  2. 4
      src/hooks/useDiscordRpc.ts

1
src/components/settings/ConfigPanels/ExternalConfig.tsx

@ -38,7 +38,6 @@ const ExternalConfig = ({ bordered }: any) => {
<StyledToggle
defaultChecked={config.external.discord.enabled}
checked={config.external.discord.enabled}
disabled={config.external.discord.clientId.length !== 18}
onChange={(e: boolean) => {
settings.set('discord.enabled', e);
dispatch(setDiscord({ ...config.external.discord, enabled: e }));

4
src/hooks/useDiscordRpc.ts

@ -12,7 +12,7 @@ const useDiscordRpc = ({ playersRef }: any) => {
const [discordRpc, setDiscordRpc] = useState<any>();
useEffect(() => {
if (config.external.discord.enabled && config.external.discord.clientId.length === 18) {
if (config.external.discord.enabled) {
const client = new RPC.Client({ transport: 'ipc' });
if (discordRpc?.client !== config.external.discord.clientId) {
@ -94,7 +94,7 @@ const useDiscordRpc = ({ playersRef }: any) => {
return () => clearInterval(interval);
}
return () => clearInterval();
return () => {};
}, [
config.external.discord.enabled,
config.external.discord.serverImage,

Loading…
Cancel
Save