diff options
| author | Georgios Andreadis <info@gandreadis.com> | 2020-07-10 10:21:46 +0200 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2020-08-24 19:48:01 +0200 |
| commit | 8aa174e70c01631ae4e00a6d208966fcd77cf972 (patch) | |
| tree | 35ec6527e8d7a0b4093e18c8cb501c293a18b5eb /frontend/src/sagas/topology.js | |
| parent | 607e8c72d85bf79dcd9bf28df96b239e2764bc30 (diff) | |
Add implementation of portfolio and scenario UI structure
Diffstat (limited to 'frontend/src/sagas/topology.js')
| -rw-r--r-- | frontend/src/sagas/topology.js | 15 |
1 files changed, 4 insertions, 11 deletions
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) } |
