Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/Social connection after same removed #4942

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions src/components/views/verification/SocialProfile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
import styled from 'styled-components';

import { useRouter } from 'next/router';
import { useCallback, useMemo, useState } from 'react';
import { useCallback, useState } from 'react';
import { Shadow } from '@/components/styled-components/Shadow';
import DiscordIcon from '/public/images/icons/social/discord.svg';
import LinkedinIcon from '/public/images/icons/social/linkedin.svg';
Expand Down Expand Up @@ -48,16 +48,16 @@ const SocialProfile = () => {
[verificationData],
);

const [twitterData, setTwitterData] = useState(
useMemo(() => findSocialMedia('twitter'), [findSocialMedia]),
const [twitterData, setTwitterData] = useState(() =>
findSocialMedia('twitter'),
);

const [linkedinData, setLinkedinData] = useState(
useMemo(() => findSocialMedia('linkedin'), [findSocialMedia]),
const [linkedinData, setLinkedinData] = useState(() =>
findSocialMedia('linkedin'),
);
const [discordData, setDiscordData] = useState(
useMemo(() => findSocialMedia('discord'), [findSocialMedia]),
const [discordData, setDiscordData] = useState(() =>
findSocialMedia('discord'),
);

async function handleSocialSubmit(
socialNetwork: string,
notAuthorized: boolean,
Expand Down Expand Up @@ -114,7 +114,7 @@ const SocialProfile = () => {
// Loop through the states to find and update the matching one
Object.keys(stateHandlers).forEach(key => {
if (id === Number(findSocialMedia(key)?.id)) {
stateHandlers[key](null);
stateHandlers[key](undefined);
}
});

Expand Down
Loading