wiz messaging and alert (#713)

Co-authored-by: Drew Ansbacher <drew.ansbacher@spiredigital.com>
This commit is contained in:
Drew Ansbacher
2021-10-21 17:46:33 -06:00
committed by Aiden McClelland
parent 65a4b8ab84
commit c30141c4f0
2 changed files with 15 additions and 2 deletions

View File

@@ -25,7 +25,7 @@
</ion-button>
</ion-buttons>
</ion-item>
<p style="margin-top: 8px;">We suggest you copy and save your tor adress in a safe place.</p>
<p style="margin-top: 8px;">We suggest you copy and save your tor adress in a safe place. This page will no longer be available once you access your Embassy.</p>
<div (click)="toggleLan()">
<ion-icon

View File

@@ -1,5 +1,5 @@
import { Component } from '@angular/core'
import { ToastController } from '@ionic/angular'
import { AlertController, ToastController } from '@ionic/angular'
import { StateService } from 'src/app/services/state.service'
@Component({
@@ -10,6 +10,7 @@ import { StateService } from 'src/app/services/state.service'
export class SuccessPage {
constructor (
private readonly toastCtrl: ToastController,
private readonly alertCtrl: AlertController,
public readonly stateService: StateService,
) { }
@@ -34,6 +35,18 @@ export class SuccessPage {
}
async copyToClipboard (str: string): Promise<boolean> {
const alert = await this.alertCtrl.create({
header: 'Please Save',
message: 'Make sure you save the address to your Embassy in a safe place.',
buttons: [
{
text: 'OK',
role: 'cancel',
},
],
})
await alert.present()
if (window.isSecureContext) {
return navigator.clipboard.writeText(str)
.then(() => {