From 52865c97f820b883977179930ce4961abdb39c12 Mon Sep 17 00:00:00 2001 From: Georgios Andreadis Date: Fri, 3 Jul 2020 11:46:29 +0200 Subject: Fix integer IDs and topology deletion --- frontend/src/reducers/construction-mode.js | 4 ++-- frontend/src/reducers/current-ids.js | 6 +++--- frontend/src/reducers/simulation-mode.js | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'frontend/src/reducers') diff --git a/frontend/src/reducers/construction-mode.js b/frontend/src/reducers/construction-mode.js index 3b500b59..ac281667 100644 --- a/frontend/src/reducers/construction-mode.js +++ b/frontend/src/reducers/construction-mode.js @@ -10,7 +10,7 @@ import { } from '../actions/topology/building' import { DELETE_ROOM, START_RACK_CONSTRUCTION, STOP_RACK_CONSTRUCTION } from '../actions/topology/room' -export function currentRoomInConstruction(state = -1, action) { +export function currentRoomInConstruction(state = '-1', action) { switch (action.type) { case START_NEW_ROOM_CONSTRUCTION_SUCCEEDED: return action.roomId @@ -21,7 +21,7 @@ export function currentRoomInConstruction(state = -1, action) { case OPEN_EXPERIMENT_SUCCEEDED: case FINISH_ROOM_EDIT: case DELETE_ROOM: - return -1 + return '-1' default: return state } diff --git a/frontend/src/reducers/current-ids.js b/frontend/src/reducers/current-ids.js index 76ae67c7..b80d2ecf 100644 --- a/frontend/src/reducers/current-ids.js +++ b/frontend/src/reducers/current-ids.js @@ -2,18 +2,18 @@ import { OPEN_EXPERIMENT_SUCCEEDED } from '../actions/experiments' import { OPEN_SIMULATION_SUCCEEDED } from '../actions/simulations' import { RESET_CURRENT_TOPOLOGY, SET_CURRENT_TOPOLOGY } from '../actions/topology/building' -export function currentTopologyId(state = -1, action) { +export function currentTopologyId(state = '-1', action) { switch (action.type) { case SET_CURRENT_TOPOLOGY: return action.topologyId case RESET_CURRENT_TOPOLOGY: - return -1 + return '-1' default: return state } } -export function currentSimulationId(state = -1, action) { +export function currentSimulationId(state = '-1', action) { switch (action.type) { case OPEN_SIMULATION_SUCCEEDED: return action.id diff --git a/frontend/src/reducers/simulation-mode.js b/frontend/src/reducers/simulation-mode.js index ea15ffa9..5f938ec8 100644 --- a/frontend/src/reducers/simulation-mode.js +++ b/frontend/src/reducers/simulation-mode.js @@ -4,12 +4,12 @@ import { SET_PLAYING } from '../actions/simulation/playback' import { GO_TO_TICK, SET_LAST_SIMULATED_TICK } from '../actions/simulation/tick' import { OPEN_SIMULATION_SUCCEEDED } from '../actions/simulations' -export function currentExperimentId(state = -1, action) { +export function currentExperimentId(state = '-1', action) { switch (action.type) { case OPEN_EXPERIMENT_SUCCEEDED: return action.experimentId case OPEN_SIMULATION_SUCCEEDED: - return -1 + return '-1' default: return state } -- cgit v1.2.3