diff --git a/src/components/dialogs/nuxs/InviteFriendsAnnouncement.tsx b/src/components/dialogs/nuxs/InviteFriendsAnnouncement.tsx index 8a8577d807..1ef8c5dbbc 100644 --- a/src/components/dialogs/nuxs/InviteFriendsAnnouncement.tsx +++ b/src/components/dialogs/nuxs/InviteFriendsAnnouncement.tsx @@ -1,9 +1,7 @@ import {useCallback} from 'react' import {View} from 'react-native' import {Image} from 'expo-image' -import {msg} from '@lingui/core/macro' -import {useLingui} from '@lingui/react' -import {Trans} from '@lingui/react/macro' +import {Trans, useLingui} from '@lingui/react/macro' import {atoms as a, useTheme, web} from '#/alf' import {Button, ButtonText} from '#/components/Button' @@ -22,7 +20,7 @@ export const enabled = createIsEnabledCheck(() => { export function InviteFriendsAnnouncement() { const t = useTheme() - const {_} = useLingui() + const {t: l} = useLingui() const nuxDialogs = useNuxDialogContext() const control = Dialog.useDialogControl() @@ -37,9 +35,9 @@ export function InviteFriendsAnnouncement() { // the invite dialog. The invite dialog is mounted persistently by NuxDialogs // (not here) so it survives the dismissal - the native bottom sheet cannot // hand off to a second sheet mounted in this same subtree. Defer the open to - // the next tick so the announcement's teardown completes first. + // the next frame so the announcement's teardown completes first. control.close(() => { - setTimeout(() => nuxDialogs.openInviteFriends()) + requestAnimationFrame(() => nuxDialogs.openInviteFriends()) }) }, [control, nuxDialogs]) @@ -52,7 +50,7 @@ export function InviteFriendsAnnouncement() {