Implement changes for #6
This commit is contained in:
parent
e9682c1871
commit
bd37b370c8
2 changed files with 43 additions and 1 deletions
|
@ -23,5 +23,10 @@
|
|||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<p class="small text">Can't scan? Use this <a [href]="zcashUrl">wallet link</a>.
|
||||
</mat-dialog-actions>
|
||||
<div align="center">
|
||||
<p class="small text">Can't scan? Use this <a [href]="zcashUrl">wallet link</a>, or</p>
|
||||
<button class="small text" (click)="copyAddress()">Copy Address</button>
|
||||
<button class="small text" (click)="copyAmount()">Copy Amount</button>
|
||||
<button class="small text" (click)="copyMemo()">Copy Memo</button>
|
||||
</div>
|
||||
|
|
|
@ -53,4 +53,41 @@ export class ScanComponent implements OnInit{
|
|||
close() {
|
||||
this.dialogRef.close(false);
|
||||
}
|
||||
|
||||
copyAddress() {
|
||||
if (!navigator.clipboard) {
|
||||
alert("Copy functionality not supported");
|
||||
}
|
||||
try {
|
||||
navigator.clipboard.writeText(this.address);
|
||||
} catch (err) {
|
||||
console.error("Error", err);
|
||||
}
|
||||
}
|
||||
|
||||
copyAmount() {
|
||||
if (!navigator.clipboard) {
|
||||
alert("Copy functionality not supported");
|
||||
}
|
||||
try {
|
||||
navigator.clipboard.writeText(this.total.toString());
|
||||
} catch (err) {
|
||||
console.error("Error", err);
|
||||
}
|
||||
}
|
||||
|
||||
copyMemo() {
|
||||
if (!navigator.clipboard) {
|
||||
alert("Copy functionality not supported");
|
||||
}
|
||||
try {
|
||||
if (this.pay) {
|
||||
navigator.clipboard.writeText("ZGOp::" + this.session);
|
||||
} else {
|
||||
navigator.clipboard.writeText("ZGO::" + this.session + " Reply-To:<your z-addr>");
|
||||
}
|
||||
} catch (err) {
|
||||
console.error("Error", err);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue