= {} as ElementRef
private ctx: CanvasRenderingContext2D = {} as CanvasRenderingContext2D
@@ -35,7 +32,6 @@ export class SuccessPage {
torAddress = ''
lanAddress = ''
cert = ''
- isOnBottom = true
tileSize = 16
// a higher fade factor will make the characters fade quicker
@@ -46,16 +42,15 @@ export class SuccessPage {
constructor(
@Inject(DOCUMENT) private readonly document: Document,
- private readonly toastCtrl: ToastController,
private readonly errCtrl: ErrorToastService,
private readonly stateService: StateService,
- private api: ApiService,
+ private readonly api: ApiService,
private readonly downloadHtml: DownloadHTMLService,
- private ngZone: NgZone,
+ private readonly ngZone: NgZone,
) {}
- get recoverySource() {
- return this.stateService.recoverySource
+ get setupType() {
+ return this.stateService.setupType
}
get isKiosk() {
@@ -66,20 +61,12 @@ export class SuccessPage {
this.ngZone.runOutsideAngular(() => this.initMatrix())
try {
const ret = await this.api.complete()
- if (!this.isKiosk) {
- setTimeout(() => this.checkBottom(), 42)
-
+ if (this.isKiosk) {
+ await pauseFor(4000)
+ } else {
this.torAddress = ret['tor-address']
this.lanAddress = ret['lan-address']
this.cert = ret['root-ca']
-
- this.document
- .getElementById('install-cert')
- ?.setAttribute(
- 'href',
- 'data:application/x-x509-ca-cert;base64,' +
- encodeURIComponent(this.cert),
- )
}
await this.api.exit()
} catch (e: any) {
@@ -87,24 +74,6 @@ export class SuccessPage {
}
}
- async copy(address: string): Promise {
- const success = await copyToClipboard(address)
- const message = success
- ? 'Copied to clipboard!'
- : 'Failed to copy to clipboard.'
-
- const toast = await this.toastCtrl.create({
- header: message,
- position: 'bottom',
- duration: 1000,
- })
- await toast.present()
- }
-
- installCert() {
- this.document.getElementById('install-cert')?.click()
- }
-
download() {
const torAddress = this.document.getElementById('tor-addr')
const lanAddress = this.document.getElementById('lan-addr')
@@ -125,14 +94,7 @@ export class SuccessPage {
})
}
- checkBottom() {
- const bottomDiv = document.getElementById('bottom-div')
- this.isOnBottom =
- !!bottomDiv &&
- bottomDiv.getBoundingClientRect().top - 192 < window.innerHeight
- }
-
- initMatrix() {
+ private initMatrix() {
this.ctx = this.canvas.nativeElement.getContext('2d')!
this.canvas.nativeElement.width = window.innerWidth
this.canvas.nativeElement.height = window.innerHeight
@@ -140,7 +102,7 @@ export class SuccessPage {
this.tick()
}
- setupMatrixGrid() {
+ private setupMatrixGrid() {
this.maxStackHeight = Math.ceil(this.ctx.canvas.height / this.tileSize)
// divide the canvas into columns
for (let i = 0; i < this.ctx.canvas.width / this.tileSize; ++i) {
diff --git a/frontend/projects/ui/src/app/app/preloader/preloader.component.ts b/frontend/projects/ui/src/app/app/preloader/preloader.component.ts
index f9ebbb6c5..1941df96c 100644
--- a/frontend/projects/ui/src/app/app/preloader/preloader.component.ts
+++ b/frontend/projects/ui/src/app/app/preloader/preloader.component.ts
@@ -39,6 +39,7 @@ const ICONS = [
'finger-print-outline',
'flash-outline',
'folder-open-outline',
+ 'globe-outline',
'grid-outline',
'help-circle-outline',
'hammer-outline',
@@ -70,6 +71,7 @@ const ICONS = [
'remove',
'remove-circle-outline',
'remove-outline',
+ 'repeat-outline',
'rocket-outline',
'save-outline',
'settings-outline',