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:
parent
c93b8ef7fc
commit
89d9f397c7
@ -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;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user