diff --git a/ui/src/app/modals/os-welcome/os-welcome.page.html b/ui/src/app/modals/os-welcome/os-welcome.page.html index e2bb774ef..44ab51f24 100644 --- a/ui/src/app/modals/os-welcome/os-welcome.page.html +++ b/ui/src/app/modals/os-welcome/os-welcome.page.html @@ -6,29 +6,35 @@ - Welcome to EmbassyOS {{ version }}! + Welcome to {{ version }}! -

Highlights

-

- 0.2.8 is a small but important update designed to enhance awareness around potential pitfalls of using certain services. - It introduces warnings for installing, uninstalling, backing up, and restoring backups of stateful services such as LND or c-lightning. - 0.2.8 introduces automatic checks for updates, a setting that can be enabled or disabled in your Embassy config, and it also draws a distinction between services that are designed to be launched inside the browser and those that are designed to run in the background. -

+
+
+

Highlights

+

+ 0.2.8 is a small but important update designed to enhance awareness around potential pitfalls of using certain services. + It introduces warnings for installing, uninstalling, backing up, and restoring backups of stateful services such as LND or c-lightning. + 0.2.8 introduces automatic checks for updates, a setting that can be enabled or disabled in your Embassy config, and it also draws a distinction between services that are designed to be launched inside the browser and those that are designed to run in the background. +

-
-
Important
-

- If you have LND or c-lightning installed, please update them to the latest versions. - An oversight in Start9’s USB backups system has created a situation where restoring a LND or c-lightning backup could potentially result in permanent loss of channel funds. - To be clear, DO NOT attempt to restore a LND or c-lightning backup until you have updated to the latest versions. -

+
+
Important
+

+ If you have LND or c-lightning installed, please update them to the latest versions. + An oversight in Start9’s USB backups system has created a situation where restoring a LND or c-lightning backup could potentially result in permanent loss of channel funds. + To be clear, DO NOT attempt to restore a LND or c-lightning backup until you have updated to the latest versions. +

+
+
+ +
+ + Close + +
- - - Close - \ No newline at end of file diff --git a/ui/src/app/modals/os-welcome/os-welcome.page.scss b/ui/src/app/modals/os-welcome/os-welcome.page.scss index e69de29bb..e1b29d3fe 100644 --- a/ui/src/app/modals/os-welcome/os-welcome.page.scss +++ b/ui/src/app/modals/os-welcome/os-welcome.page.scss @@ -0,0 +1,8 @@ +.close-button { + width: 100%; + display: flex; + justify-content: center; + align-items: center; + height: 100%; + min-height: 100px; +} \ No newline at end of file diff --git a/ui/src/app/services/server-config.service.ts b/ui/src/app/services/server-config.service.ts index 3553145df..f3c8274b3 100644 --- a/ui/src/app/services/server-config.service.ts +++ b/ui/src/app/services/server-config.service.ts @@ -59,8 +59,8 @@ export class ServerConfigService { description: 'On launch, EmabssyOS will automatically check for updates of itself and your installed services. Updating still requires user approval and action. No updates will ever be performed automatically.', default: true, }, - saveFn: (val: string) => { - return this.apiService.patchServerConfig('autoCheckUpdates', val).then(() => this.serverModel.update({ name: val })) + saveFn: (val: boolean) => { + return this.apiService.patchServerConfig('autoCheckUpdates', val).then(() => this.serverModel.update({ autoCheckUpdates: val })) }, }, // password: { @@ -121,5 +121,5 @@ export class ServerConfigService { interface SpecAndSaveFn { spec: ValueSpec - saveFn: (val: string) => Promise + saveFn: (val: any) => Promise } diff --git a/ui/src/app/services/sync.notifier.ts b/ui/src/app/services/sync.notifier.ts index 38a0899c4..2360fc264 100644 --- a/ui/src/app/services/sync.notifier.ts +++ b/ui/src/app/services/sync.notifier.ts @@ -90,21 +90,31 @@ export class SyncNotifier { } private async handleUpdateCheck (server: Readonly) { + debugSync('handleUpdateCheck', server) if (!server.autoCheckUpdates || this.checkedForUpdates) return this.checkedForUpdates = true - + debugSync('handleUpdateCheck', 'checkedForUpdates=true') if (server.versionLatest && this.emver.compare(server.versionInstalled, server.versionLatest) === -1) { - return this.presentAlertNewOS(server.versionLatest) + debugSync('handleUpdateCheck', 'OS Update') + // if cancel selected, move on to newApps + const { update } = await this.presentAlertNewOS(server.versionLatest) + debugSync('handleUpdateCheck', 'OS Update', 'response', update) + if (update) { + return this.updateEmbassyOS(server.versionLatest).catch(e => alert(e)) + } } try { + debugSync('handleUpdateCheck', 'Apps Check') + const availableApps = await this.apiService.getAvailableApps() if (!!availableApps.find(app => this.emver.compare(app.versionInstalled, app.versionLatest) === -1)) { + debugSync('handleUpdateCheck', 'Apps Check', 'new apps found') return this.presentAlertNewApps() } - } catch { - this.checkedForUpdates = false + } catch (e) { + console.error(`Exception checking for new apps: `, e) } } @@ -112,42 +122,44 @@ export class SyncNotifier { const alert = await this.alertCtrl.create({ backdropDismiss: true, header: 'Updates Available!', - message: 'New service updates are availbale in the Marketplace.', + message: 'New service updates are available in the Marketplace.', buttons: [ { text: 'Cancel', - role: 'cancel' + role: 'cancel', }, { text: 'View in Marketplace', handler: () => { return this.navCtrl.navigateForward('/services/marketplace') - } - } - ] + }, + }, + ], }) + await alert.present() } - private async presentAlertNewOS (versionLatest: string) { - const alert = await this.alertCtrl.create({ - backdropDismiss: true, - header: 'New EmbassyOS Version!', - message: `Update EmbassyOS to version ${versionLatest}?`, - buttons: [ - { - text: 'Not now', - role: 'cancel' - }, - { - text: 'Update', - handler: () => { - return this.updateEmbassyOS(versionLatest) - } - } - ] + private async presentAlertNewOS (versionLatest: string): Promise<{ cancel?: true, update?: true }> { + return new Promise(async resolve => { + const alert = await this.alertCtrl.create({ + backdropDismiss: true, + header: 'New EmbassyOS Version!', + message: `Update EmbassyOS to version ${versionLatest}?`, + buttons: [ + { + text: 'Not now', + role: 'cancel', + handler: () => resolve({ cancel: true }), + }, + { + text: 'Update', + handler: () => resolve({ update: true }), + }, + ], + }) + await alert.present() }) - await alert.present() } private async updateEmbassyOS (versionLatest: string) { @@ -159,3 +171,47 @@ export class SyncNotifier { .catch(e => alert(e)) } } + +// @TODO: remove +function debugSync (...desc: any[]) { + console.log(`sync: `, ...desc) +} + + +// return new Promise(async resolve => { +// const confirm = await this.alertController.create({ +// cssClass: 'alert-demo', +// header: 'Warning', +// message: `
This is a hosted instance of Burn After Reading.
+//

Since you are not the server operator, you can never be 100% certain that your data are private or secure.

+//

You can run your own, private instance with the click of a button using the Start9 Embassy.

`, +// buttons: [ +// { +// text: 'Run my Own', +// handler: () => { +// const a = document.createElement('a') +// const site = (this.config.isConsulate || !this.config.isTor) ? 'https://start9labs.com' : 'http://privacy34kn4ez3y3nijweec6w4g54i3g54sdv7r5mr6soma3w4begyd.onion/' +// a.href = site +// a.target = '_blank' +// pauseFor(500).then(() => a.click()) +// return resolve() +// }, +// }, +// { +// text: 'Use Demo', +// role: 'cancel', +// handler: () => resolve(), +// }, +// ], +// }) + +// await confirm.present() + +// const alert = document.getElementsByClassName('alert-demo').item(0) +// this.cleanup( +// fromEvent(alert, 'keyup') +// .pipe(filter((k: KeyboardEvent) => isEnter(k))) +// .subscribe(() => confirm.dismiss()), +// ) +// }) +// } \ No newline at end of file