Fixed unused map source being set on peer map data
This commit is contained in:
parent
6e8cb833aa
commit
671c8d7bf7
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user