Merge pull request #8199 from overleaf/ii-settings-ts-fixes

[web] Fix TS errors in settings area

GitOrigin-RevId: 48f3695570bd794b4865bd45a29aa6fc9bf57502
This commit is contained in:
Timothée Alby 2022-05-30 12:18:44 +02:00 committed by Copybot
parent 5bc28ffa8c
commit 20d5291308
3 changed files with 14 additions and 7 deletions

View file

@ -120,7 +120,8 @@ function AddEmail() {
/>
</Cell>
</Col>
{ssoAvailableForDomain(newEmailMatchedDomain) ? (
{newEmailMatchedDomain &&
ssoAvailableForDomain(newEmailMatchedDomain) ? (
<Col md={8}>
<Cell>
<SsoLinkingInfo

View file

@ -125,11 +125,17 @@ function Input({ onChange, handleAddNewEmail }: InputProps) {
if (suggestion) {
setInputValueAndResetSuggestion()
} else {
const match = matchLocalAndDomain(inputValue)
if (match.local && match.domain) {
handleAddNewEmail()
}
return
}
if (!inputValue) {
return
}
const match = matchLocalAndDomain(inputValue)
if (match.local && match.domain) {
handleAddNewEmail()
}
}

View file

@ -11,7 +11,7 @@ function Email({ userEmailData }: EmailProps) {
const { t } = useTranslation()
const ssoAvailable = ssoAvailableForInstitution(
userEmailData.affiliation?.institution
userEmailData.affiliation?.institution || null
)
return (