readd awaits

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton committed 2022-05-02 11:29:07 -04:00
1 parent c93b8ef7fc
commit 89d9f397c7
2 files changed
+7 -7

No files matched your search

@@ -95,13 +95,13 @@ class NonInjectedKubeObjectMenu<Kube extends KubeObject> extends React.Component
onClick: withConfirmation({
message: this.renderRemoveMessage(object),
labelOk: "Remove",
ok: () => {
ok: async () => {
hideDetails();
if (removeAction) {
removeAction();
await removeAction();
} else if (store?.remove) {
store.remove(object);
await store.remove(object);
}
},
}),
@@ -112,11 +112,11 @@ class NonInjectedKubeObjectMenu<Kube extends KubeObject> extends React.Component
this.menuItems.push({
title: "Edit",
icon: "edit",
onClick: () => {
onClick: async () => {
hideDetails();
if (updateAction) {
updateAction();
await updateAction();
} else {
createEditResourceTab(object);
}
@@ -31,11 +31,11 @@ export interface MenuActionsProps extends Partial<MenuProps> {
/**
* @deprecated Provide your own update `<MenuItem>` as part of the `children` passed to this component
*/
updateAction?: () => void;
updateAction?: () => void | Promise<void>;
/**
* @deprecated Provide your own remove `<MenuItem>` as part of the `children` passed to this component
*/
removeAction?: () => void;
removeAction?: () => void | Promise<void>;
onOpen?: () => void;
}