Skip to content

Commit

Permalink
Don't use this.props on a functional component
Browse files Browse the repository at this point in the history
  • Loading branch information
KKoukiou committed Feb 14, 2023
1 parent 715996a commit 7d66688
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/PodActions.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export const PodActions = ({ onAddNotification, pod }) => {
client.postPod(pod.isSystem, "stop", pod.Id, { t: 0 })
.catch(ex => {
const error = cockpit.format(_("Failed to force stop pod $0"), pod.Name);
this.props.onAddNotification({ type: 'danger', error, errorDetail: ex.message });
onAddNotification({ type: 'danger', error, errorDetail: ex.message });
})}
component="button">
{_("Force stop")}
Expand All @@ -100,7 +100,7 @@ export const PodActions = ({ onAddNotification, pod }) => {
client.postPod(pod.isSystem, "restart", pod.Id, {})
.catch(ex => {
const error = cockpit.format(_("Failed to restart pod $0"), pod.Name);
this.props.onAddNotification({ type: 'danger', error, errorDetail: ex.message });
onAddNotification({ type: 'danger', error, errorDetail: ex.message });
})}
component="button">
{_("Restart")}
Expand All @@ -111,7 +111,7 @@ export const PodActions = ({ onAddNotification, pod }) => {
client.postPod(pod.isSystem, "restart", pod.Id, { t: 0 })
.catch(ex => {
const error = cockpit.format(_("Failed to force restart pod $0"), pod.Name);
this.props.onAddNotification({ type: 'danger', error, errorDetail: ex.message });
onAddNotification({ type: 'danger', error, errorDetail: ex.message });
})}
component="button">
{_("Force restart")}
Expand All @@ -126,7 +126,7 @@ export const PodActions = ({ onAddNotification, pod }) => {
client.postPod(pod.isSystem, "start", pod.Id, {})
.catch(ex => {
const error = cockpit.format(_("Failed to start pod $0"), pod.Name);
this.props.onAddNotification({ type: 'danger', error, errorDetail: ex.message });
onAddNotification({ type: 'danger', error, errorDetail: ex.message });
})}
component="button">
{_("Start")}
Expand All @@ -141,7 +141,7 @@ export const PodActions = ({ onAddNotification, pod }) => {
client.postPod(pod.isSystem, "unpause", pod.Id, {})
.catch(ex => {
const error = cockpit.format(_("Failed to resume pod $0"), pod.Name);
this.props.onAddNotification({ type: 'danger', error, errorDetail: ex.message });
onAddNotification({ type: 'danger', error, errorDetail: ex.message });
})}
component="button">
{_("Resume")}
Expand All @@ -156,7 +156,7 @@ export const PodActions = ({ onAddNotification, pod }) => {
client.postPod(pod.isSystem, "pause", pod.Id, {})
.catch(ex => {
const error = cockpit.format(_("Failed to pause pod $0"), pod.Name);
this.props.onAddNotification({ type: 'danger', error, errorDetail: ex.message });
onAddNotification({ type: 'danger', error, errorDetail: ex.message });
})}
component="button">
{_("Pause")}
Expand Down

0 comments on commit 7d66688

Please sign in to comment.