Fixed bug with corrupted map state on token deletion

This commit is contained in:
Mitchell McCaffrey
2021-04-16 13:36:14 +10:00
parent 3577938501
commit 1d5cf77aea
7 changed files with 36 additions and 24 deletions

View File

@@ -31,7 +31,6 @@ function MapToken({
onTokenDragStart,
onTokenDragEnd,
draggable,
mapState,
fadeOnHover,
map,
}) {
@@ -111,7 +110,6 @@ function MapToken({
mountedToken.moveTo(parent);
mountedToken.absolutePosition(position);
mountChanges[mountedToken.id()] = {
...mapState.tokens[mountedToken.id()],
x: mountedToken.x() / mapWidth,
y: mountedToken.y() / mapHeight,
lastModifiedBy: userId,
@@ -124,7 +122,6 @@ function MapToken({
onTokenStateChange({
...mountChanges,
[tokenState.id]: {
...tokenState,
x: tokenGroup.x() / mapWidth,
y: tokenGroup.y() / mapHeight,
lastModifiedBy: userId,