fix instructions link (#239)

This commit is contained in:
Matt Hill
2021-03-08 17:25:24 -07:00
committed by GitHub
parent 5339b23ea6
commit a056f6d318
2 changed files with 13 additions and 5 deletions

View File

@@ -36,7 +36,7 @@
</ion-label> </ion-label>
</ion-item> </ion-item>
<ion-item> <ion-item>
<ion-button slot="start" fill="clear" color="primary">View Instructions</ion-button> <ion-button slot="start" fill="clear" color="primary" (click)="viewInstructions()">View Instructions</ion-button>
</ion-item> </ion-item>
<ng-container *ngIf="!lanDisabled"> <ng-container *ngIf="!lanDisabled">

View File

@@ -12,8 +12,8 @@ import { ApiService } from 'src/app/services/api/api.service'
styleUrls: ['./lan.page.scss'], styleUrls: ['./lan.page.scss'],
}) })
export class LANPage { export class LANPage {
torDocs = 'docs.privacy34kn4ez3y3nijweec6w4g54i3g54sdv7r5mr6soma3w4begyd.onion/user-manual/general/secure-lan' torDocs = 'docs.privacy34kn4ez3y3nijweec6w4g54i3g54sdv7r5mr6soma3w4begyd.onion/user-manual/general/lan-setup'
lanDocs = 'docs.start9labs.com/user-manual/general/secure-lan' lanDocs = 'docs.start9labs.com/user-manual/general/lan-setup'
lanAddress: string lanAddress: string
fullDocumentationLink: string fullDocumentationLink: string
@@ -60,6 +60,14 @@ export class LANPage {
}) })
} }
viewInstructions (): void {
if (this.config.isConsulate) {
this.copyInstructions()
} else {
window.open(this.fullDocumentationLink, '_blank')
}
}
async copyLAN (): Promise <void> { async copyLAN (): Promise <void> {
const message = await copyToClipboard(this.lanAddress).then(success => success ? 'copied to clipboard!' : 'failed to copy') const message = await copyToClipboard(this.lanAddress).then(success => success ? 'copied to clipboard!' : 'failed to copy')
@@ -72,9 +80,9 @@ export class LANPage {
await toast.present() await toast.present()
} }
async copyDocumentation (): Promise < void > { async copyInstructions (): Promise < void > {
const message = await copyToClipboard(this.fullDocumentationLink).then( const message = await copyToClipboard(this.fullDocumentationLink).then(
success => success ? 'copied documentation link to clipboard!' : 'failed to copy', success => success ? 'copied link to clipboard!' : 'failed to copy',
) )
const toast = await this.toastCtrl.create({ const toast = await this.toastCtrl.create({