From 7c3293775bbfefb79fbc71fc8de7a3298ba0c9b0 Mon Sep 17 00:00:00 2001 From: KoalaSat Date: Thu, 17 Nov 2022 17:29:56 +0000 Subject: [PATCH] Fix export chat android (#324) * Fix export chat button on Android * Fix export chat button on Android --- .../TradeBox/EncryptedChat/ChatBottom/index.tsx | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/frontend/src/components/TradeBox/EncryptedChat/ChatBottom/index.tsx b/frontend/src/components/TradeBox/EncryptedChat/ChatBottom/index.tsx index a1de80b2..3d535c34 100644 --- a/frontend/src/components/TradeBox/EncryptedChat/ChatBottom/index.tsx +++ b/frontend/src/components/TradeBox/EncryptedChat/ChatBottom/index.tsx @@ -4,6 +4,7 @@ import { ExportIcon } from '../../../Icons'; import KeyIcon from '@mui/icons-material/Key'; import { useTranslation } from 'react-i18next'; import { saveAsJson } from '../../../../utils'; +import { systemClient } from '../../../../services/System'; interface Props { orderId: number; @@ -16,6 +17,14 @@ const ChatBottom: React.FC = ({ orderId, setAudit, audit, createJsonFile const { t } = useTranslation(); const theme = useTheme(); + const onPGPClick: () => void = () => { + if (window.ReactNativeWebView === undefined) { + saveAsJson('complete_log_chat_' + orderId + '.json', createJsonFile()); + } else { + systemClient.copyToClipboard(JSON.stringify(createJsonFile())); + } + }; + return ( <> @@ -41,12 +50,7 @@ const ChatBottom: React.FC = ({ orderId, setAudit, audit, createJsonFile enterNextDelay={2000} title={t('Save full log as a JSON file (messages and credentials)')} > -