1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

readd awaits

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

View File

@ -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);
}

View File

@ -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;
}