mirror of
https://github.com/RoboSats/robosats.git
synced 2024-12-14 03:16:24 +00:00
Fix export chat android (#324)
* Fix export chat button on Android * Fix export chat button on Android
This commit is contained in:
parent
9d80ca6fdb
commit
7c3293775b
@ -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<Props> = ({ 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 (
|
||||
<>
|
||||
<Grid item xs={6}>
|
||||
@ -41,12 +50,7 @@ const ChatBottom: React.FC<Props> = ({ orderId, setAudit, audit, createJsonFile
|
||||
enterNextDelay={2000}
|
||||
title={t('Save full log as a JSON file (messages and credentials)')}
|
||||
>
|
||||
<Button
|
||||
size='small'
|
||||
color='primary'
|
||||
variant='outlined'
|
||||
onClick={() => saveAsJson('complete_log_chat_' + orderId + '.json', createJsonFile())}
|
||||
>
|
||||
<Button size='small' color='primary' variant='outlined' onClick={onPGPClick}>
|
||||
<div style={{ width: '1.4em', height: '1.4em' }}>
|
||||
<ExportIcon sx={{ width: '0.8em', height: '0.8em' }} />
|
||||
</div>{' '}
|
||||
|
Loading…
Reference in New Issue
Block a user