lan address added

This commit is contained in:
Drew Ansbacher
2021-10-17 18:33:46 -06:00
committed by Aiden McClelland
parent 55bf7c71da
commit cc2e937216
7 changed files with 35 additions and 12 deletions

View File

@@ -91,7 +91,7 @@ export class EmbassyPage {
this.stateService.embassyPassword = ret.data.password
try {
this.stateService.torAddress = (await this.stateService.setupEmbassy()).torAddress
await this.stateService.setupEmbassy()
} catch (e) {
this.errorToastService.present(`${e.message}: ${e.details}`)
console.error(e.message)

View File

@@ -20,7 +20,7 @@
<p>{{ stateService.torAddress }}</p>
</ion-label>
<ion-buttons>
<ion-button fill="clear" (click)="copy()">
<ion-button fill="clear" (click)="copy(stateService.torAddress)">
<ion-icon size="small" slot="icon-only" name="copy-outline"></ion-icon>
</ion-button>
</ion-buttons>
@@ -41,7 +41,7 @@
<div
[ngStyle]="{
'overflow' : 'hidden',
'max-height': lanInstructionsOpen ? '355px' : '0px',
'max-height': lanInstructionsOpen ? '455px' : '0px',
'transition': 'max-height 0.4s ease-out'
}"
>
@@ -65,6 +65,19 @@
<p>Download and trust your Embassy's Root Cert</p>
</ion-label>
</ion-item>
<p style="padding-top: 10px;" class="addr-label">LAN Address:</p>
<ion-item style="--border-radius: 8px !important;" color="medium">
<ion-label>
<p>{{ stateService.lanAddress }}</p>
</ion-label>
<ion-buttons>
<ion-button fill="clear" (click)="copy(stateService.lanAddress)">
<ion-icon size="small" slot="icon-only" name="copy-outline"></ion-icon>
</ion-button>
</ion-buttons>
</ion-item>
</ion-item-group>
</div>
</ion-card-content>

View File

@@ -16,9 +16,9 @@ export class SuccessPage {
window = window
lanInstructionsOpen = false
async copy (): Promise<void> {
async copy (address: string): Promise<void> {
let message = ''
await this.copyToClipboard(this.stateService.torAddress)
await this.copyToClipboard(address)
.then(success => message = success ? 'copied to clipboard!' : 'failed to copy')
const toast = await this.toastCtrl.create({