fix confirm modal controller

This commit is contained in:
Niels Lyngsø
2024-03-01 13:16:23 +01:00
parent b92188972c
commit b9fa95c192
3 changed files with 5 additions and 2 deletions

View File

@@ -17,6 +17,7 @@ export class UmbDeleteEntityAction<
color: 'danger',
confirmLabel: 'Delete',
});
await this.repository?.delete(this.unique);
}
}

View File

@@ -27,6 +27,7 @@ export class UmbExtensionCollectionElement extends UmbCollectionDefaultElement {
});
}
// TODO: make this a utility function, please check that we do not already have on for this: [NL]
// credit: https://stackoverflow.com/a/7225450/12787 [LK]
#camelCaseToWords(input: string) {
const result = input.replace(/([A-Z])/g, ' $1');
@@ -35,7 +36,6 @@ export class UmbExtensionCollectionElement extends UmbCollectionDefaultElement {
#onChange(event: UUISelectEvent) {
const extensionType = event.target.value;
console.log('onChange', extensionType);
this.#collectionContext?.setFilter({ type: extensionType });
}

View File

@@ -13,9 +13,11 @@ export class UmbConfirmModalController extends UmbControllerBase {
data: args,
});
await modalContext.onSubmit().catch(() => {
const p = modalContext.onSubmit();
p.catch(() => {
this.destroy();
});
await p;
// This is a one time off, so we can destroy our selfs.
this.destroy();