show available marketplace updates in menu (#1613)

* show service updates in menu
This commit is contained in:
Lucy C
2022-07-05 13:02:32 -06:00
committed by GitHub
parent e2d58c2959
commit 88afb756f5
17 changed files with 162 additions and 107 deletions

View File

@@ -24,11 +24,7 @@ export class MarketplaceListPage {
startWith({}),
)
readonly categories$ = this.marketplaceService
.getCategories()
.pipe(
map(categories => new Set(['featured', 'updates', ...categories, 'all'])),
)
readonly categories$ = this.marketplaceService.getCategories()
readonly pkgs$: Observable<MarketplacePkg[]> = this.patch
.watch$('server-info')

View File

@@ -7,23 +7,25 @@
</ion-toolbar>
</ion-header>
<ion-content *ngIf="ui$ | async as ui" class="ion-padding-top">
<ion-item-group *ngIf="server$ | async as server">
<ion-item-divider>General</ion-item-divider>
<ion-item button (click)="presentModalName('Embassy-' + server.id)">
<ion-label>Device Name</ion-label>
<ion-note slot="end">{{ ui.name || 'Embassy-' + server.id }}</ion-note>
</ion-item>
<ion-content class="ion-padding-top">
<ng-container *ngIf="ui$ | async as ui">
<ion-item-group *ngIf="server$ | async as server">
<ion-item-divider>General</ion-item-divider>
<ion-item button (click)="presentModalName('Embassy-' + server.id)">
<ion-label>Device Name</ion-label>
<ion-note slot="end">{{ ui.name || 'Embassy-' + server.id }}</ion-note>
</ion-item>
<ion-item-divider>Marketplace</ion-item-divider>
<ion-item
button
(click)="serverConfig.presentAlert('auto-check-updates', ui['auto-check-updates'] !== false)"
>
<ion-label>Auto Check for Updates</ion-label>
<ion-note slot="end">
{{ ui['auto-check-updates'] !== false ? 'Enabled' : 'Disabled' }}
</ion-note>
</ion-item>
</ion-item-group>
<ion-item-divider>Marketplace</ion-item-divider>
<ion-item
button
(click)="serverConfig.presentAlert('auto-check-updates', ui['auto-check-updates'] !== false)"
>
<ion-label>Auto Check for Updates</ion-label>
<ion-note slot="end">
{{ ui['auto-check-updates'] !== false ? 'Enabled' : 'Disabled' }}
</ion-note>
</ion-item>
</ion-item-group>
</ng-container>
</ion-content>

View File

@@ -1,7 +1,6 @@
import { Component, ViewChild } from '@angular/core'
import { PatchDbService } from 'src/app/services/patch-db/patch-db.service'
import {
IonContent,
LoadingController,
ModalController,
ToastController,
@@ -20,7 +19,6 @@ import { LocalStorageService } from '../../../services/local-storage.service'
styleUrls: ['./preferences.page.scss'],
})
export class PreferencesPage {
@ViewChild(IonContent) content: IonContent
clicks = 0
readonly ui$ = this.patch.watch$('ui')
@@ -36,10 +34,6 @@ export class PreferencesPage {
readonly serverConfig: ServerConfigService,
) {}
ngAfterViewInit() {
this.content.scrollToPoint(undefined, 1)
}
async presentModalName(placeholder: string): Promise<void> {
const options: GenericInputOptions = {
title: 'Edit Device Name',