summaryrefslogtreecommitdiff
path: root/frontend/src/store
diff options
context:
space:
mode:
authorGeorgios Andreadis <info@gandreadis.com>2020-07-03 11:46:29 +0200
committerFabian Mastenbroek <mail.fabianm@gmail.com>2020-08-24 19:47:22 +0200
commit52865c97f820b883977179930ce4961abdb39c12 (patch)
tree6b429d80694d7e5729fb1f41ff8f9ba4b2d07d4b /frontend/src/store
parent39277c91281dbc7bd40bdffabc5b5675e9ede483 (diff)
Fix integer IDs and topology deletion
Diffstat (limited to 'frontend/src/store')
-rw-r--r--frontend/src/store/middlewares/viewport-adjustment.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/frontend/src/store/middlewares/viewport-adjustment.js b/frontend/src/store/middlewares/viewport-adjustment.js
index ae8f032a..84f2a3e9 100644
--- a/frontend/src/store/middlewares/viewport-adjustment.js
+++ b/frontend/src/store/middlewares/viewport-adjustment.js
@@ -12,20 +12,20 @@ import { calculateRoomListBounds } from '../../util/tile-calculations'
export const viewportAdjustmentMiddleware = store => next => action => {
const state = store.getState()
- let topologyId = -1
+ let topologyId = '-1'
let mapDimensions = {}
- if (action.type === SET_CURRENT_TOPOLOGY && action.topologyId !== -1) {
+ if (action.type === SET_CURRENT_TOPOLOGY && action.topologyId !== '-1') {
topologyId = action.topologyId
mapDimensions = state.map.dimensions
} else if (
action.type === SET_MAP_DIMENSIONS &&
- state.currentTopologyId !== -1
+ state.currentTopologyId !== '-1'
) {
topologyId = state.currentTopologyId
mapDimensions = { width: action.width, height: action.height }
}
- if (topologyId !== -1) {
+ if (topologyId !== '-1') {
const roomIds = state.objects.topology[topologyId].roomIds
const rooms = roomIds.map(id => Object.assign({}, state.objects.room[id]))
rooms.forEach(