Skip to content

Commit

Permalink
fix: Use React state to avoid new page load in Workflow view (#5058)
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Behar <[email protected]>
  • Loading branch information
simster7 authored Feb 9, 2021
1 parent a0669b5 commit 26f48a9
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const WorkflowDetails = ({history, location, match}: RouteComponentProps<
const queryParams = new URLSearchParams(location.search);

const [namespace] = useState(match.params.namespace);
const [name] = useState(match.params.name);
const [name, setName] = useState(match.params.name);
const [tab, setTab] = useState(queryParams.get('tab') || 'workflow');
const [nodeId, setNodeId] = useState(queryParams.get('nodeId'));
const [sidePanel, setSidePanel] = useState(queryParams.get('sidePanel'));
Expand Down Expand Up @@ -81,8 +81,7 @@ export const WorkflowDetails = ({history, location, match}: RouteComponentProps<
if (workflowOperation.title === 'DELETE') {
navigation.goto(uiUrl(`workflows/${workflow.metadata.namespace}`));
} else {
// navigation.goto does not seem to work here
document.location.href = uiUrl(`workflows/${wf.metadata.namespace}/${wf.metadata.name}`);
setName(wf.metadata.name);
}
})
.catch(setError);
Expand Down

0 comments on commit 26f48a9

Please sign in to comment.