Improve instructions on NoAccessScreen and bday dialog (#9571)

This commit is contained in:
Eric Bailey
2025-12-18 11:05:39 -06:00
committed by GitHub
parent 89cffdf5d0
commit a355eedf85
2 changed files with 47 additions and 46 deletions
+14 -1
View File
@@ -4,6 +4,7 @@ import {msg, Trans} from '@lingui/macro'
import {useLingui} from '@lingui/react'
import {useCleanError} from '#/lib/hooks/useCleanError'
import {isAppPassword} from '#/lib/jwt'
import {getAge, getDateAgo} from '#/lib/strings/time'
import {logger} from '#/logger'
import {isIOS, isWeb} from '#/platform/detection'
@@ -15,6 +16,7 @@ import {
usePreferencesQuery,
type UsePreferencesQueryResponse,
} from '#/state/queries/preferences'
import {useSession} from '#/state/session'
import {ErrorMessage} from '#/view/com/util/error/ErrorMessage'
import {atoms as a, useTheme, web} from '#/alf'
import {Admonition} from '#/components/Admonition'
@@ -23,7 +25,7 @@ import * as Dialog from '#/components/Dialog'
import {DateField} from '#/components/forms/DateField'
import {SimpleInlineLinkText} from '#/components/Link'
import {Loader} from '#/components/Loader'
import {Text} from '#/components/Typography'
import {Span, Text} from '#/components/Typography'
export function BirthDateSettingsDialog({
control,
@@ -34,6 +36,8 @@ export function BirthDateSettingsDialog({
const {_} = useLingui()
const {isLoading, error, data: preferences} = usePreferencesQuery()
const isBirthdateUpdateAllowed = useIsBirthdateUpdateAllowed()
const {currentAccount} = useSession()
const isUsingAppPassword = isAppPassword(currentAccount?.accessJwt || '')
return (
<Dialog.Outer control={control} nativeOptions={{preventExpansion: true}}>
@@ -65,6 +69,15 @@ export function BirthDateSettingsDialog({
}
style={[a.rounded_sm]}
/>
) : isUsingAppPassword ? (
<Admonition type="info">
<Trans>
Hmm, it looks like you're logged in with an{' '}
<Span style={[a.italic]}>App Password</Span>. To set your
birthdate, you'll need to log in with your main account
password, or ask whomever controls this account to do so.
</Trans>
</Admonition>
) : (
<BirthdayInner control={control} preferences={preferences} />
)}