github.com/replicatedhq/ship@v0.55.0/web/init/src/redux/data/appRoutes/reducer.js (about) 1 import { constants } from "./actions"; 2 3 const routesDataState = { 4 routes: [], 5 isKustomizeFlow: false, 6 isDone: false 7 }; 8 9 export function routesData(state = routesDataState, action) { 10 switch (action.type) { 11 case constants.RECEIVE_ROUTES: 12 let isKustomize = false; 13 for (let i = 0; i < action.payload.length; i++) { 14 if (action.payload[i].phase.includes("helm")) { 15 isKustomize = true; 16 break; 17 } 18 } 19 return Object.assign({}, state, { 20 routes: action.payload, 21 isKustomizeFlow: isKustomize 22 }); 23 case constants.SHUTDOWN_APP: 24 return Object.assign({}, state, { 25 isDone: true 26 }); 27 default: 28 return state; 29 } 30 }