Fixed sending empty map bug when double clicking the delete map button

Also fixed default map resolution sending to peers
This commit is contained in:
Mitchell McCaffrey 2020-07-18 16:58:29 +10:00
parent bd9ea18572
commit 17c2205e07

View File

@ -64,6 +64,11 @@ function NetworkedMapAndTokens({ session }) {
setCurrentMapState(newMapState);
setCurrentMap(newMap);
session.send("map", null, "map");
if (!newMap || !newMapState) {
return;
}
session.send("mapState", newMapState);
session.send("map", getMapDataToSend(newMap), "map");
const tokensToSend = getMapTokensToSend(newMapState);
@ -252,7 +257,7 @@ function NetworkedMapAndTokens({ session }) {
if (id === "mapRequest") {
const map = getMap(data);
function replyWithFile(file) {
reply("mapResponse", { ...map, file, resolutions: [] }, "map");
reply("mapResponse", { ...map, file, resolutions: {} }, "map");
}
switch (map.quality) {