mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 20:14:49 +00:00
toast errors and some styling
This commit is contained in:
committed by
Aiden McClelland
parent
c2313b4eb3
commit
6bbe19aed7
@@ -11,11 +11,8 @@
|
||||
|
||||
<ion-content>
|
||||
<text-spinner *ngIf="loading; else loaded" [text]="'Loading ' + title | titlecase"></text-spinner>
|
||||
<ng-template #loaded>
|
||||
<ion-item *ngIf="error" style="margin-bottom: 16px;">
|
||||
<ion-text class="ion-text-wrap" color="danger">{{ error }}</ion-text>
|
||||
</ion-item>
|
||||
|
||||
<ng-template #loaded>
|
||||
<div *ngIf="content" class="content-padding" [innerHTML]="content | markdown"></div>
|
||||
</ng-template>
|
||||
</ion-content>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { Component, Input } from '@angular/core'
|
||||
import { ModalController } from '@ionic/angular'
|
||||
import { ApiService } from 'src/app/services/api/api.service'
|
||||
import { ErrorToastService } from 'src/app/services/error-toast.service'
|
||||
|
||||
@Component({
|
||||
selector: 'markdown',
|
||||
@@ -12,10 +13,10 @@ export class MarkdownPage {
|
||||
@Input() title: string
|
||||
content: string
|
||||
loading = true
|
||||
error = ''
|
||||
|
||||
constructor (
|
||||
private readonly modalCtrl: ModalController,
|
||||
private readonly errToast: ErrorToastService,
|
||||
private readonly apiService: ApiService,
|
||||
) { }
|
||||
|
||||
@@ -23,7 +24,8 @@ export class MarkdownPage {
|
||||
try {
|
||||
this.content = await this.apiService.getStatic(this.contentUrl)
|
||||
} catch (e) {
|
||||
this.error = e.message
|
||||
console.error(e.message)
|
||||
this.errToast.present(e.message)
|
||||
} finally {
|
||||
this.loading = false
|
||||
}
|
||||
|
||||
@@ -18,7 +18,8 @@ export class OSWelcomePage {
|
||||
) { }
|
||||
|
||||
async dismiss () {
|
||||
this.apiService.setDbValue({ pointer: '/welcome-ack', value: this.config.version }).catch(console.error)
|
||||
this.apiService.setDbValue({ pointer: '/welcome-ack', value: this.config.version })
|
||||
.catch(console.error)
|
||||
|
||||
// return false to skip subsequent alert modals (e.g. check for updates modals)
|
||||
// return true to show subsequent alert modals
|
||||
|
||||
Reference in New Issue
Block a user