From 8aa174e70c01631ae4e00a6d208966fcd77cf972 Mon Sep 17 00:00:00 2001 From: Georgios Andreadis Date: Fri, 10 Jul 2020 10:21:46 +0200 Subject: Add implementation of portfolio and scenario UI structure --- frontend/src/sagas/topology.js | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'frontend/src/sagas/topology.js') diff --git a/frontend/src/sagas/topology.js b/frontend/src/sagas/topology.js index 008c7b63..e915f9ff 100644 --- a/frontend/src/sagas/topology.js +++ b/frontend/src/sagas/topology.js @@ -20,16 +20,7 @@ import { fetchAndStoreTopology, updateTopologyOnServer } from './objects' import { uuid } from 'uuidv4' import { addTopology, deleteTopology } from '../api/routes/topologies' -export function* fetchTopologyOfExperiment(experiment) { - try { - yield fetchAndStoreTopology(experiment.topologyId) - yield put(setCurrentTopology(experiment.topologyId)) - } catch (error) { - console.error(error) - } -} - -export function* fetchAndStoreAllTopologiesOfProject(projectId) { +export function* fetchAndStoreAllTopologiesOfProject(projectId, setTopology = false) { try { const project = yield select((state) => state.objects.project[projectId]) @@ -37,7 +28,9 @@ export function* fetchAndStoreAllTopologiesOfProject(projectId) { yield fetchAndStoreTopology(project.topologyIds[i]) } - yield put(setCurrentTopology(project.topologyIds[0])) + if (setTopology) { + yield put(setCurrentTopology(project.topologyIds[0])) + } } catch (error) { console.error(error) } -- cgit v1.2.3