mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 20:14:49 +00:00
only one modal submit block needed
This commit is contained in:
committed by
Matt Hill
parent
952205f85a
commit
a54dfd96a3
@@ -27,8 +27,10 @@ export class AppComponent {
|
|||||||
@HostListener('document:keypress', ['$event'])
|
@HostListener('document:keypress', ['$event'])
|
||||||
handleKeyboardEvent (event: KeyboardEvent) {
|
handleKeyboardEvent (event: KeyboardEvent) {
|
||||||
if (event.key === 'Enter') {
|
if (event.key === 'Enter') {
|
||||||
|
|
||||||
const elems = document.getElementsByClassName('enter-click')
|
const elems = document.getElementsByClassName('enter-click')
|
||||||
const elem = elems[elems.length - 1] as HTMLButtonElement
|
const elem = elems[elems.length - 1] as HTMLButtonElement
|
||||||
|
if (elem.classList.contains('no-click')) return
|
||||||
if (elem) elem.click()
|
if (elem) elem.click()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -99,7 +101,7 @@ export class AppComponent {
|
|||||||
|
|
||||||
this.patch.watch$()
|
this.patch.watch$()
|
||||||
.pipe(
|
.pipe(
|
||||||
filter(data => !isEmptyObject(data)),
|
filter(data => !isEmptyObject(data as object)),
|
||||||
take(1),
|
take(1),
|
||||||
)
|
)
|
||||||
.subscribe(_ => {
|
.subscribe(_ => {
|
||||||
|
|||||||
@@ -81,7 +81,7 @@
|
|||||||
<ion-footer>
|
<ion-footer>
|
||||||
<ion-toolbar *ngIf="patch.data['package-data'][pkgId] as pkg">
|
<ion-toolbar *ngIf="patch.data['package-data'][pkgId] as pkg">
|
||||||
<ion-buttons slot="end" class="ion-padding-end">
|
<ion-buttons slot="end" class="ion-padding-end">
|
||||||
<ion-button fill="outline" [disabled]="loadingText" (click)="save(pkg)" class="enter-click">
|
<ion-button fill="outline" [disabled]="saving" (click)="save(pkg)" class="enter-click" [class.no-click]="saving">
|
||||||
Save
|
Save
|
||||||
</ion-button>
|
</ion-button>
|
||||||
</ion-buttons>
|
</ion-buttons>
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ export class AppConfigPage {
|
|||||||
configForm: FormGroup
|
configForm: FormGroup
|
||||||
current: object
|
current: object
|
||||||
hasConfig = false
|
hasConfig = false
|
||||||
|
saving = false
|
||||||
|
|
||||||
rec: Recommendation | null = null
|
rec: Recommendation | null = null
|
||||||
showRec = true
|
showRec = true
|
||||||
@@ -128,6 +129,7 @@ export class AppConfigPage {
|
|||||||
const config = this.configForm.value
|
const config = this.configForm.value
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
this.saving = true
|
||||||
const breakages = await this.embassyApi.drySetPackageConfig({
|
const breakages = await this.embassyApi.drySetPackageConfig({
|
||||||
id: pkg.manifest.id,
|
id: pkg.manifest.id,
|
||||||
config,
|
config,
|
||||||
@@ -152,6 +154,7 @@ export class AppConfigPage {
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.errToast.present(e)
|
this.errToast.present(e)
|
||||||
} finally {
|
} finally {
|
||||||
|
this.saving = false
|
||||||
loader.dismiss()
|
loader.dismiss()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user