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