From 671c8d7bf7e5c69a2dd5e16dd74e84e35b28b1bf Mon Sep 17 00:00:00 2001 From: Mitchell McCaffrey Date: Sat, 25 Apr 2020 00:43:15 +1000 Subject: [PATCH] Fixed unused map source being set on peer map data --- src/routes/Game.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/routes/Game.js b/src/routes/Game.js index dc7923c..635155e 100644 --- a/src/routes/Game.js +++ b/src/routes/Game.js @@ -186,12 +186,10 @@ function Game() { } } if (data.id === "map") { - // If we have a file convert it to a url - // TODO clear the file url of the previous map if it's a blob - if (data.data && data.data.file) { + if (data.data && data.data.type === "file") { + // Convert file back to blob after peer transfer const file = new Blob([data.data.file]); - const source = URL.createObjectURL(file); - setMap({ ...data.data, file, source }); + setMap({ ...data.data, file }); } else { setMap(data.data); }