Skip to content

Commit

Permalink
only show copy button on ios
Browse files Browse the repository at this point in the history
  • Loading branch information
Abby Wheelis committed Sep 9, 2023
1 parent a6a5581 commit 91b24d2
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions www/js/control/PopOpCode.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ const PopOpCode = ({visibilityValue, tokenURL, action, setVis}) => {

const opcodeList = tokenURL.split("=");
const opcode = opcodeList[opcodeList.length - 1];
const platform = window.cordova.platformId;

const [copyAlertVis, setCopyAlertVis] = useState(false);

Expand All @@ -20,7 +19,12 @@ const PopOpCode = ({visibilityValue, tokenURL, action, setVis}) => {
setCopyAlertvis(true);
})
}


let copyButton;
if (window.cordova.platformId == "ios"){
copyButton = <IconButton icon="content-copy" onPress={() => {copyText(opcode); setCopyAlertVis(true)}} style={styles.button}/>
}

return (
<>
<Modal visible={visibilityValue} onDismiss={() => setVis(false)}
Expand All @@ -36,7 +40,7 @@ const PopOpCode = ({visibilityValue, tokenURL, action, setVis}) => {
</Dialog.Content>
<Dialog.Actions>
<IconButton icon="share" onPress={() => action()} style={styles.button}/>
<IconButton icon="content-copy" onPress={platform=="android" ? () => {} : () => {copyText(opcode); setCopyAlertVis(true)}} style={styles.button}/>
{copyButton}
<Button onPress={() => setVis(false)} style={styles.button}>{t('general-settings.cancel')}</Button>
</Dialog.Actions>
</Dialog>
Expand Down

0 comments on commit 91b24d2

Please sign in to comment.