Skip to content

Commit

Permalink
check pipeline ID in URL and use if it exists
Browse files Browse the repository at this point in the history
Signed-off-by: Sajid Alam <[email protected]>
  • Loading branch information
SajidAlamQB committed Aug 16, 2024
1 parent 885d0e2 commit f463cab
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/components/flowchart-wrapper/flowchart-wrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,15 @@ export const FlowChartWrapper = ({
*/
const setParamsFromLocalStorage = (activePipeline) => {
const localStorageParams = loadLocalStorage(localStorageName);
const pipelineIdFromUrl = searchParams.get(params.pipeline);

if (localStorageParams) {
const paramActions = {
pipeline: (value) => {
if (activePipeline) {
// Check if there's a pipeline ID in the URL, if so use it
if (pipelineIdFromUrl) {
toSetQueryParam(params.pipeline, pipelineIdFromUrl);
} else if (activePipeline) {
toSetQueryParam(params.pipeline, value.active || activePipeline);
}
},
Expand Down

0 comments on commit f463cab

Please sign in to comment.