Clear map actions on reset

This commit is contained in:
Mitchell McCaffrey
2021-02-22 17:14:12 +11:00
parent d244471870
commit 53d4e05502
5 changed files with 11 additions and 10 deletions
+3 -2
View File
@@ -229,8 +229,9 @@ function NetworkedMapAndTokens({ session }) {
await loadAssetManifestFromMap(newMap, newMapState);
}
function handleMapStateChange(newMapState) {
function handleMapReset(newMapState) {
setCurrentMapState(newMapState, true, true);
setMapActions(defaultMapActions);
}
const [mapActions, setMapActions] = useState(defaultMapActions);
@@ -569,7 +570,7 @@ function NetworkedMapAndTokens({ session }) {
onMapTokenStateChange={handleMapTokenStateChange}
onMapTokenStateRemove={handleMapTokenStateRemove}
onMapChange={handleMapChange}
onMapStateChange={handleMapStateChange}
onMapReset={handleMapReset}
onMapDraw={handleMapDraw}
onMapDrawUndo={handleMapDrawUndo}
onMapDrawRedo={handleMapDrawRedo}