Implemented own blob to buffer function, fixed permission bug by creating copy of map file
This commit is contained in:
@@ -11,6 +11,7 @@ import MapSettings from "../components/map/MapSettings";
|
||||
import AuthContext from "../contexts/AuthContext";
|
||||
|
||||
import usePrevious from "../helpers/usePrevious";
|
||||
import blobToBuffer from "../helpers/blobToBuffer";
|
||||
|
||||
import { maps as defaultMaps } from "../maps";
|
||||
|
||||
@@ -140,11 +141,14 @@ function SelectMapModal({
|
||||
}
|
||||
let image = new Image();
|
||||
setImageLoading(true);
|
||||
|
||||
// Copy file to avoid permissions issues
|
||||
const copy = new Blob([file], { type: file.type });
|
||||
// Create and load the image temporarily to get its dimensions
|
||||
const url = URL.createObjectURL(file);
|
||||
const url = URL.createObjectURL(copy);
|
||||
image.onload = function () {
|
||||
handleMapAdd({
|
||||
file,
|
||||
file: copy,
|
||||
name,
|
||||
type: "file",
|
||||
gridX: fileGridX,
|
||||
|
||||
Reference in New Issue
Block a user