mirror of
https://github.com/RoboSats/robosats.git
synced 2025-01-22 06:01:35 +00:00
Add copied feedback to Android pgp export
This commit is contained in:
parent
7c3293775b
commit
ddcad444b6
@ -17,14 +17,6 @@ const ChatBottom: React.FC<Props> = ({ orderId, setAudit, audit, createJsonFile
|
|||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
|
|
||||||
const onPGPClick: () => void = () => {
|
|
||||||
if (window.ReactNativeWebView === undefined) {
|
|
||||||
saveAsJson('complete_log_chat_' + orderId + '.json', createJsonFile());
|
|
||||||
} else {
|
|
||||||
systemClient.copyToClipboard(JSON.stringify(createJsonFile()));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Grid item xs={6}>
|
<Grid item xs={6}>
|
||||||
@ -43,6 +35,7 @@ const ChatBottom: React.FC<Props> = ({ orderId, setAudit, audit, createJsonFile
|
|||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<Grid item xs={6}>
|
<Grid item xs={6}>
|
||||||
|
{window.ReactNativeWebView === undefined ? (
|
||||||
<Tooltip
|
<Tooltip
|
||||||
placement='bottom'
|
placement='bottom'
|
||||||
enterTouchDelay={0}
|
enterTouchDelay={0}
|
||||||
@ -50,13 +43,33 @@ const ChatBottom: React.FC<Props> = ({ orderId, setAudit, audit, createJsonFile
|
|||||||
enterNextDelay={2000}
|
enterNextDelay={2000}
|
||||||
title={t('Save full log as a JSON file (messages and credentials)')}
|
title={t('Save full log as a JSON file (messages and credentials)')}
|
||||||
>
|
>
|
||||||
<Button size='small' color='primary' variant='outlined' onClick={onPGPClick}>
|
<Button
|
||||||
|
size='small'
|
||||||
|
color='primary'
|
||||||
|
variant='outlined'
|
||||||
|
onClick={() => saveAsJson('complete_log_chat_' + orderId + '.json', createJsonFile())}
|
||||||
|
>
|
||||||
<div style={{ width: '1.4em', height: '1.4em' }}>
|
<div style={{ width: '1.4em', height: '1.4em' }}>
|
||||||
<ExportIcon sx={{ width: '0.8em', height: '0.8em' }} />
|
<ExportIcon sx={{ width: '0.8em', height: '0.8em' }} />
|
||||||
</div>{' '}
|
</div>{' '}
|
||||||
{t('Export')}{' '}
|
{t('Export')}{' '}
|
||||||
</Button>
|
</Button>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
|
) : (
|
||||||
|
<Tooltip disableHoverListener enterTouchDelay={0} title={t('Copied!')}>
|
||||||
|
<Button
|
||||||
|
size='small'
|
||||||
|
color='primary'
|
||||||
|
variant='outlined'
|
||||||
|
onClick={() => systemClient.copyToClipboard(JSON.stringify(createJsonFile()))}
|
||||||
|
>
|
||||||
|
<div style={{ width: '1.4em', height: '1.4em' }}>
|
||||||
|
<ExportIcon sx={{ width: '0.8em', height: '0.8em' }} />
|
||||||
|
</div>{' '}
|
||||||
|
{t('Export')}{' '}
|
||||||
|
</Button>
|
||||||
|
</Tooltip>
|
||||||
|
)}
|
||||||
</Grid>
|
</Grid>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user