fix pronouns type

This commit is contained in:
vidvidvid
2021-10-07 17:38:15 +02:00
committed by Alec LaLonde
parent fb99fdbe4c
commit 2aeed3e49e
2 changed files with 4 additions and 5 deletions

View File

@@ -7,7 +7,7 @@ import React, { useState } from 'react';
export type SetupPronounsProps = {
pronouns: string;
setPronouns: React.Dispatch<React.SetStateAction<string | undefined>>;
setPronouns: React.Dispatch<React.SetStateAction<string>>;
};
export const SetupPronouns: React.FC<SetupPronounsProps> = ({
@@ -31,7 +31,7 @@ export const SetupPronouns: React.FC<SetupPronounsProps> = ({
const { error } = await updatePronouns({
playerId: user.id,
input: {
pronouns: pronouns ?? '',
pronouns,
},
});
@@ -65,7 +65,6 @@ export const SetupPronouns: React.FC<SetupPronounsProps> = ({
/>
<MetaButton
disabled={!user}
onClick={handleNextPress}
mt={10}
isLoading={updatePronounsRes.fetching || loading}

View File

@@ -14,12 +14,12 @@ export const getStaticProps = async () => ({
export type DefaultSetupProps = InferGetStaticPropsType<typeof getStaticProps>;
const PronounsSetup: React.FC<DefaultSetupProps> = () => {
const [pronouns, setPronouns] = useState<string | undefined>(undefined);
const [pronouns, setPronouns] = useState<string>('');
const { user } = useUser();
if (user?.player) {
const { player } = user;
if (player.pronouns && pronouns === undefined) {
if (player.pronouns && pronouns === '') {
setPronouns(player.pronouns);
}
}