Merge branch 'dev'

This commit is contained in:
Rene Vergara 2022-05-26 08:55:21 -05:00
commit ada9ec7bfc
Signed by: pitmutt
GPG key ID: 65122AD495A7F5B2
2 changed files with 43 additions and 1 deletions

View file

@ -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>

View file

@ -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);
}
}
}