mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-04 22:35:51 -05:00
cf2dfc6bf1
[SettingsPage] Integration Branch GitOrigin-RevId: 5a3c26b2a02d716c4ae3981e3f08b811ae307725
22 lines
699 B
TypeScript
22 lines
699 B
TypeScript
import { State } from '../context/user-email-context'
|
|
import { UserEmailData } from '../../../../../types/user-email'
|
|
|
|
export const inReconfirmNotificationPeriod = (userEmailData: UserEmailData) => {
|
|
return userEmailData.affiliation?.inReconfirmNotificationPeriod
|
|
}
|
|
|
|
export const institutionAlreadyLinked = (
|
|
state: State,
|
|
userEmailData: UserEmailData
|
|
) => {
|
|
const institutionId = userEmailData.affiliation?.institution.id?.toString()
|
|
|
|
return institutionId !== undefined
|
|
? state.data.linkedInstitutionIds.includes(institutionId)
|
|
: false
|
|
}
|
|
|
|
export const isChangingAffiliation = (
|
|
state: State,
|
|
email: UserEmailData['email']
|
|
) => state.data.emailAffiliationBeingEdited === email
|