Fix setting friend code when using a presence URL

This commit is contained in:
Samuel Elliott
2022-09-26 16:55:41 +01:00
parent 19f9ba74ec
commit 4a7277795c

View File

@@ -82,7 +82,8 @@ export default function Preferences(props: PreferencesProps) {
const discord_friend_code_self = discord_presence_source_user?.nsoAccount.user.links.friendCode.id;
const [is_discord_friend_code_self, setIsDiscordFriendCodeSelf] = useState(false);
useEffect(() => {
setIsDiscordFriendCodeSelf(!!discord_presence_source && (!discord_friend_code || discord_friend_code === discord_friend_code_self));
setIsDiscordFriendCodeSelf(!!discord_friend_code_self &&
(!discord_friend_code || discord_friend_code === discord_friend_code_self));
}, [discord_presence_source, discord_friend_code_self]);
useEventListener(events, 'window:refresh', () => (