This commit is contained in:
Aaron Greenspan
2021-01-21 10:53:48 -07:00
committed by Aiden McClelland
parent b8d84c5fc2
commit 8096bef541
2 changed files with 18 additions and 6 deletions

View File

@@ -16,7 +16,7 @@
Additionally, it draws a distinction between services that are designed to be launched inside the browser and those that are designed to run in the background
</p>
<p>
0.2.8 also introduces automatic checks for OS updates. With this enabled, each time you visit your embassy you will be notified if a new OS version is available. This setting can be edited in your Embassy Config page.
0.2.8 also introduces automatic update checks. With this enabled, each time you visit your embassy you will be notified if new Embassy OS or service versions are available. This setting can be edited in your Embassy Config page.
<ion-item lines="none" style="--border-radius: var(--icon-border-radius); margin-top: 15px">
<ion-label>Auto Check for Updates</ion-label>
<ion-toggle slot="end" [(ngModel)]="autoCheckUpdates"></ion-toggle>

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core'
import { AlertController, ModalController, NavController } from '@ionic/angular'
import { AlertController, IonicSafeString, ModalController, NavController } from '@ionic/angular'
import { OSWelcomePage } from '../modals/os-welcome/os-welcome.page'
import { S9Server } from '../models/server-model'
import { displayEmver } from '../pipes/emver.pipe'
@@ -28,7 +28,7 @@ export class StartupAlertsNotifier {
// Then, since we await acc before c.display(res), each promise executing gets hung awaiting the display of the previous run
async runChecks (server: Readonly<S9Server>): Promise<void> {
await this.checks
.filter(c => c.shouldRun(server) && !c.hasRun)
.filter(c => !c.hasRun && c.shouldRun(server))
.reduce(async (previousDisplay, c) => {
let checkRes
try {
@@ -37,8 +37,8 @@ export class StartupAlertsNotifier {
return console.error(`Exception in ${c.name} check:`, e)
}
c.hasRun = true
if (!checkRes) return true
const displayRes = await previousDisplay
if (!checkRes) return true
if (displayRes) return c.display(checkRes)
}, Promise.resolve(true))
}
@@ -124,7 +124,13 @@ export class StartupAlertsNotifier {
const alert = await this.alertCtrl.create({
backdropDismiss: true,
header: 'Updates Available!',
message: 'New service updates are available in the Marketplace.',
message: new IonicSafeString(
`<div style="display: flex; flex-direction: column; justify-content: space-around; min-height: 100px">
<div>New service updates are available in the Marketplace.</div>
<div style="font-size:x-small">You can disable these checks in your Embassy Config</div>
</div>
`
),
buttons: [
{
text: 'Cancel',
@@ -149,7 +155,13 @@ export class StartupAlertsNotifier {
const alert = await this.alertCtrl.create({
backdropDismiss: true,
header: 'New EmbassyOS Version!',
message: `Update EmbassyOS to version ${displayEmver(versionLatest)}?`,
message: new IonicSafeString(
`<div style="display: flex; flex-direction: column; justify-content: space-around; min-height: 100px">
<div>Update EmbassyOS to version ${displayEmver(versionLatest)}?</div>
<div style="font-size:x-small">You can disable these checks in your Embassy Config</div>
</div>
`
),
buttons: [
{
text: 'Not now',