Added a clear map call to map changes

This commit is contained in:
Mitchell McCaffrey 2021-01-04 09:48:08 +11:00
parent 30a1319298
commit abd5f12269

View File

@ -174,6 +174,10 @@ function NetworkedMapAndTokens({ session }) {
}, [currentMap, debouncedMapState, userId, database]);
function handleMapChange(newMap, newMapState) {
// Clear map before sending new one
setCurrentMap(null);
session.socket?.emit("map", null);
setCurrentMapState(newMapState, true, true);
setCurrentMap(newMap);