From a68ed6ea1b87d56c79ec67256ee86079b00307dc Mon Sep 17 00:00:00 2001 From: xmflsct Date: Mon, 8 Aug 2022 23:00:46 +0200 Subject: [PATCH] Fix menu translations --- package.json | 2 +- src/components/ContextMenu/account.ts | 8 ++++---- src/components/Timeline/Shared/HeaderDefault.android.tsx | 5 ++--- .../Timeline/Shared/HeaderNotification.android.tsx | 8 ++++---- 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index 2b705bcf..c3b8f46f 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "versions": { "native": "220806", "major": 4, - "minor": 3, + "minor": 2, "patch": 0, "expo": "46.0.0" }, diff --git a/src/components/ContextMenu/account.ts b/src/components/ContextMenu/account.ts index 9678912c..7460a36d 100644 --- a/src/components/ContextMenu/account.ts +++ b/src/components/ContextMenu/account.ts @@ -41,8 +41,8 @@ const contextMenuAccount = ({ type: 'success', message: t('common:message.success.message', { function: t(`account.${theParams.payload.property}.action`, { - ...(typeof theParams.payload.currentValue === 'boolean' && { - context: theParams.payload.currentValue.toString() + ...(theParams.payload.property !== 'reports' && { + context: (theParams.payload.currentValue || false).toString() }) }) }) @@ -55,8 +55,8 @@ const contextMenuAccount = ({ type: 'error', message: t('common:message.error.message', { function: t(`account.${theParams.payload.property}.action`, { - ...(typeof theParams.payload.currentValue === 'boolean' && { - context: theParams.payload.currentValue.toString() + ...(theParams.payload.property !== 'reports' && { + context: (theParams.payload.currentValue || false).toString() }) }) }), diff --git a/src/components/Timeline/Shared/HeaderDefault.android.tsx b/src/components/Timeline/Shared/HeaderDefault.android.tsx index fb224a1a..24051752 100644 --- a/src/components/Timeline/Shared/HeaderDefault.android.tsx +++ b/src/components/Timeline/Shared/HeaderDefault.android.tsx @@ -6,11 +6,10 @@ import Icon from '@components/Icon' import { QueryKeyTimeline } from '@utils/queryHooks/timeline' import { StyleConstants } from '@utils/styles/constants' import { useTheme } from '@utils/styles/ThemeManager' -import React, { useContext } from 'react' +import React from 'react' import { useTranslation } from 'react-i18next' -import { Platform, Pressable, View } from 'react-native' +import { Pressable, View } from 'react-native' import ContextMenu, { ContextMenuAction } from 'react-native-context-menu-view' -import { ContextMenuContext } from './ContextMenu' import HeaderSharedAccount from './HeaderShared/Account' import HeaderSharedApplication from './HeaderShared/Application' import HeaderSharedCreated from './HeaderShared/Created' diff --git a/src/components/Timeline/Shared/HeaderNotification.android.tsx b/src/components/Timeline/Shared/HeaderNotification.android.tsx index 2922f516..b2331dcd 100644 --- a/src/components/Timeline/Shared/HeaderNotification.android.tsx +++ b/src/components/Timeline/Shared/HeaderNotification.android.tsx @@ -20,7 +20,7 @@ import HeaderSharedMuted from './HeaderShared/Muted' import HeaderSharedVisibility from './HeaderShared/Visibility' export interface Props { - queryKey?: QueryKeyTimeline + queryKey: QueryKeyTimeline notification: Mastodon.Notification } @@ -39,18 +39,18 @@ const TimelineHeaderNotification = ({ queryKey, notification }: Props) => { : null const statusOnPress = contextMenuStatus({ actions: contextMenuActions, - status, + status: status!, queryKey }) const accountOnPress = contextMenuAccount({ actions: contextMenuActions, type: 'status', queryKey, - id: status?.account.id + id: status!.account.id }) const instanceOnPress = contextMenuInstance({ actions: contextMenuActions, - status, + status: status!, queryKey })