diff --git a/ui/src/app/modals/os-welcome/os-welcome.page.ts b/ui/src/app/modals/os-welcome/os-welcome.page.ts index 8418d04b8..d00a01e85 100644 --- a/ui/src/app/modals/os-welcome/os-welcome.page.ts +++ b/ui/src/app/modals/os-welcome/os-welcome.page.ts @@ -2,8 +2,7 @@ import { Component, Input } from '@angular/core' import { ModalController } from '@ionic/angular' import { ServerModel } from 'src/app/models/server-model' import { ApiService } from 'src/app/services/api/api.service' -import { LoaderService } from 'src/app/services/loader.service' -import { pauseFor } from 'src/app/util/misc.util' +import { ConfigService } from 'src/app/services/config.service' @Component({ selector: 'os-welcome', @@ -19,12 +18,15 @@ export class OSWelcomePage { private readonly modalCtrl: ModalController, private readonly apiService: ApiService, private readonly serverModel: ServerModel, + private readonly config: ConfigService, ) { } + // autoCheckUpdates default must be false when upgrading to 0.2.8 async dismiss () { this.apiService .patchServerConfig('autoCheckUpdates', this.autoCheckUpdates) .then(() => this.serverModel.update({ autoCheckUpdates: this.autoCheckUpdates })) + .then(() => this.apiService.acknowledgeOSWelcome(this.config.version)) .catch(console.error), this.modalCtrl.dismiss({ autoCheckUpdates: this.autoCheckUpdates }) diff --git a/ui/src/app/services/startup-alerts.notifier.ts b/ui/src/app/services/startup-alerts.notifier.ts index cbe808879..b5e9f1821 100644 --- a/ui/src/app/services/startup-alerts.notifier.ts +++ b/ui/src/app/services/startup-alerts.notifier.ts @@ -23,7 +23,6 @@ export class StartupAlertsNotifier { displayedWelcomeMessage = false checkedForUpdates = false - welcomeSetAutoUpdateCheck = false async handleSpecial (server: Readonly): Promise { this.handleOSWelcome(server) @@ -44,17 +43,11 @@ export class StartupAlertsNotifier { }, }) - modal.onDidDismiss().then(res => { - this.welcomeSetAutoUpdateCheck = res.data.autoCheckUpdates - this.apiService.acknowledgeOSWelcome(this.config.version) - this.handleUpdateCheck(server) - }) await modal.present() } private async handleUpdateCheck (server: Readonly) { - if (this.displayedWelcomeMessage && !this.welcomeSetAutoUpdateCheck) return - if (!this.displayedWelcomeMessage && (!server.autoCheckUpdates || this.checkedForUpdates)) return + if (!server.autoCheckUpdates || this.checkedForUpdates) return this.checkedForUpdates = true if (this.osUpdateService.updateIsAvailable(server.versionInstalled, server.versionLatest)) { diff --git a/ui/use-mocks.json b/ui/use-mocks.json index 2caee7215..3425efc8a 100644 --- a/ui/use-mocks.json +++ b/ui/use-mocks.json @@ -1,3 +1,3 @@ { - "useMocks": true + "useMocks": false }