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({
|
onClick: withConfirmation({
|
||||||
message: this.renderRemoveMessage(object),
|
message: this.renderRemoveMessage(object),
|
||||||
labelOk: "Remove",
|
labelOk: "Remove",
|
||||||
ok: () => {
|
ok: async () => {
|
||||||
hideDetails();
|
hideDetails();
|
||||||
|
|
||||||
if (removeAction) {
|
if (removeAction) {
|
||||||
removeAction();
|
await removeAction();
|
||||||
} else if (store?.remove) {
|
} 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({
|
this.menuItems.push({
|
||||||
title: "Edit",
|
title: "Edit",
|
||||||
icon: "edit",
|
icon: "edit",
|
||||||
onClick: () => {
|
onClick: async () => {
|
||||||
hideDetails();
|
hideDetails();
|
||||||
|
|
||||||
if (updateAction) {
|
if (updateAction) {
|
||||||
updateAction();
|
await updateAction();
|
||||||
} else {
|
} else {
|
||||||
createEditResourceTab(object);
|
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
|
* @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
|
* @deprecated Provide your own remove `<MenuItem>` as part of the `children` passed to this component
|
||||||
*/
|
*/
|
||||||
removeAction?: () => void;
|
removeAction?: () => void | Promise<void>;
|
||||||
onOpen?: () => void;
|
onOpen?: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user