diff options
| author | Georgios Andreadis <info@gandreadis.com> | 2020-07-02 18:39:28 +0200 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2020-08-24 19:47:21 +0200 |
| commit | f119fc78dda4d1e828dde04f378a63a93e3a0a7e (patch) | |
| tree | bea1eace5d47f21a7ccb835c6a6079bc92e48710 /frontend/src/store/middlewares | |
| parent | 7f27a6370a0af25e1bf6ff8f46360c6c26c21e0b (diff) | |
Add current progress on frontend port
Diffstat (limited to 'frontend/src/store/middlewares')
| -rw-r--r-- | frontend/src/store/middlewares/viewport-adjustment.js | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/frontend/src/store/middlewares/viewport-adjustment.js b/frontend/src/store/middlewares/viewport-adjustment.js index 0a074f61..ae8f032a 100644 --- a/frontend/src/store/middlewares/viewport-adjustment.js +++ b/frontend/src/store/middlewares/viewport-adjustment.js @@ -1,5 +1,5 @@ import { SET_MAP_DIMENSIONS, setMapPosition, setMapScale } from '../../actions/map' -import { SET_CURRENT_DATACENTER } from '../../actions/topology/building' +import { SET_CURRENT_TOPOLOGY } from '../../actions/topology/building' import { MAP_MAX_SCALE, MAP_MIN_SCALE, @@ -12,21 +12,21 @@ import { calculateRoomListBounds } from '../../util/tile-calculations' export const viewportAdjustmentMiddleware = store => next => action => { const state = store.getState() - let datacenterId = -1 + let topologyId = -1 let mapDimensions = {} - if (action.type === SET_CURRENT_DATACENTER && action.datacenterId !== -1) { - datacenterId = action.datacenterId + if (action.type === SET_CURRENT_TOPOLOGY && action.topologyId !== -1) { + topologyId = action.topologyId mapDimensions = state.map.dimensions } else if ( action.type === SET_MAP_DIMENSIONS && - state.currentDatacenterId !== -1 + state.currentTopologyId !== -1 ) { - datacenterId = state.currentDatacenterId + topologyId = state.currentTopologyId mapDimensions = { width: action.width, height: action.height } } - if (datacenterId !== -1) { - const roomIds = state.objects.datacenter[datacenterId].roomIds + if (topologyId !== -1) { + const roomIds = state.objects.topology[topologyId].roomIds const rooms = roomIds.map(id => Object.assign({}, state.objects.room[id])) rooms.forEach( room => |
