From 53db8fc4ec8d69c6f241db370e978058c4fd89dc Mon Sep 17 00:00:00 2001 From: Aaron Greenspan Date: Fri, 22 Jan 2021 10:28:07 -0700 Subject: [PATCH] ui: preload bold, remove getdots from dom after load --- ui/src/app/app.component.html | 3 ++- ui/src/app/app.component.ts | 10 +++++++--- ui/src/app/services/api/mock-api.service.ts | 6 +++--- ui/src/app/services/startup-alerts.notifier.ts | 6 ++++-- 4 files changed, 16 insertions(+), 9 deletions(-) diff --git a/ui/src/app/app.component.html b/ui/src/app/app.component.html index b3969258b..c94db0d14 100644 --- a/ui/src/app/app.component.html +++ b/ui/src/app/app.component.html @@ -129,7 +129,7 @@ - + @@ -148,6 +148,7 @@ + load bold diff --git a/ui/src/app/app.component.ts b/ui/src/app/app.component.ts index 8154c739a..331b06989 100644 --- a/ui/src/app/app.component.ts +++ b/ui/src/app/app.component.ts @@ -3,7 +3,6 @@ import { ServerModel, ServerStatus } from './models/server-model' import { Storage } from '@ionic/storage' import { SyncDaemon } from './services/sync.service' import { AuthService, AuthState } from './services/auth.service' -import { StartupAlertsNotifier } from './services/startup-alerts.notifier' import { ApiService } from './services/api/api.service' import { Router } from '@angular/router' import { BehaviorSubject, Observable } from 'rxjs' @@ -14,6 +13,7 @@ import { LoaderService } from './services/loader.service' import { Emver } from './services/emver.service' import { SplitPaneTracker } from './services/split-pane.service' import { LoadingOptions } from '@ionic/core' +import { pauseFor } from './util/misc.util' @Component({ selector: 'app-root', @@ -27,6 +27,7 @@ export class AppComponent { serverName$ : Observable serverBadge$: Observable selectedIndex = 0 + untilLoaded = true appPages = [ { title: 'Services', @@ -66,7 +67,6 @@ export class AppComponent { private readonly alertCtrl: AlertController, private readonly loader: LoaderService, private readonly emver: Emver, - private readonly globalAlertsNotifier: StartupAlertsNotifier, readonly splitPane: SplitPaneTracker, ) { // set dark theme @@ -76,6 +76,10 @@ export class AppComponent { this.init() } + ionViewDidEnter(){ + pauseFor(500).then(() => this.untilLoaded = false) + } + async init () { let fromFresh = true await this.storage.ready() @@ -182,7 +186,7 @@ export class AppComponent { await alert.present() } - splitPaneVisible (e) { + splitPaneVisible (e: any) { this.splitPane.$menuFixedOpenOnLeft$.next(e.detail.visible) } } diff --git a/ui/src/app/services/api/mock-api.service.ts b/ui/src/app/services/api/mock-api.service.ts index f07c6b2b8..3c0129427 100644 --- a/ui/src/app/services/api/mock-api.service.ts +++ b/ui/src/app/services/api/mock-api.service.ts @@ -11,7 +11,7 @@ import { mockApiAppAvailableFull, mockApiAppAvailableVersionInfo, mockApiAppInst //@TODO consider moving to test folders. @Injectable() export class MockApiService extends ApiService { - welcomeAck = false + welcomeAck = true constructor ( private readonly appModel: AppModel, @@ -409,8 +409,8 @@ const mockApiServer: () => ReqRes.GetServerRes = () => ({ versionLatest: '0.2.9', status: ServerStatus.RUNNING, alternativeRegistryUrl: 'beta-registry.start9labs.com', - welcomeAck: false, - autoCheckUpdates: true, + welcomeAck: true, + autoCheckUpdates: false, specs: { 'Tor Address': 'nfsnjkcnaskjnlkasnfahj7dh23fdnieqwjdnhjewbfijendiueqwbd.onion', 'CPU': 'Broadcom BCM2711, Quad core Cortex-A72 (ARM v8) 64-bit SoC @ 1.5GHz', diff --git a/ui/src/app/services/startup-alerts.notifier.ts b/ui/src/app/services/startup-alerts.notifier.ts index 0ea89b1c6..f8aee52fc 100644 --- a/ui/src/app/services/startup-alerts.notifier.ts +++ b/ui/src/app/services/startup-alerts.notifier.ts @@ -30,14 +30,16 @@ export class StartupAlertsNotifier { await this.checks .filter(c => !c.hasRun && c.shouldRun(server)) .reduce(async (previousDisplay, c) => { - let checkRes + let checkRes: any try { checkRes = await c.check(server) } catch (e) { - return console.error(`Exception in ${c.name} check:`, e) + console.error(`Exception in ${c.name} check:`, e) + return true } c.hasRun = true const displayRes = await previousDisplay + if (!checkRes) return true if (displayRes) return c.display(checkRes) }, Promise.resolve(true))