Skip to content

Commit

Permalink
fix: allow coppy of the derived address pegout native
Browse files Browse the repository at this point in the history
  • Loading branch information
annipi authored and alexjavabraz committed Dec 10, 2024
1 parent ffbbefb commit 2165e86
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions src/pegout/components/PegoutOption.vue
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,15 @@
rounded="lg"
variant="solo"
:placeholder="session.btcDerivedAddress || 'Derived Bitcoin Address'">
<template v-slot:append-inner>
<v-chip v-if="isWalletAuthorizedToSign && !session.btcDerivedAddress"
variant="outlined" @click="$emit('openAddressDialog')">
Derive
</v-chip>
<template v-slot:append-inner
v-if="isWalletAuthorizedToSign && !session.btcDerivedAddress">
<v-chip variant="outlined" @click="$emit('openAddressDialog')">
Derive
</v-chip>
</template>
<template v-slot:append-inner v-else>
<v-icon size="x-small"
:icon="mdiContentCopy" @click="copyToClipboard" />
</template>
</v-text-field>
<v-alert
Expand Down Expand Up @@ -135,6 +139,7 @@ import {
mdiInformationOutline,
mdiOpenInNew,
mdiClockTimeThreeOutline,
mdiContentCopy,
} from '@mdi/js';
import EnvironmentContextProviderService from '@/common/providers/EnvironmentContextProvider';
import { useAction, useState, useStateAttribute } from '@/common/store/helper';
Expand Down Expand Up @@ -276,6 +281,10 @@ export default defineComponent({
window.open(link, '_blank');
}
function copyToClipboard() {
navigator.clipboard.writeText(session.value.btcDerivedAddress || '');
}
return {
mdiSendOutline,
environmentContext,
Expand All @@ -300,6 +309,8 @@ export default defineComponent({
mdiClockTimeThreeOutline,
totalFee,
tooltipText,
mdiContentCopy,
copyToClipboard,
};
},
});
Expand Down

0 comments on commit 2165e86

Please sign in to comment.