@overmap-ai/core 1.0.18-fix-misc-issues.2 → 1.0.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -803,8 +803,7 @@ const useFileSrc = (props) => {
803
803
  useEffect(() => {
804
804
  if (!fileSha1 || !file)
805
805
  return;
806
- const encodedUrl = encodeURI(file);
807
- sdk.files.fetchFileFromUrl(encodedUrl, fileSha1).then((file2) => {
806
+ sdk.files.fetchFileFromUrl(file, fileSha1).then((file2) => {
808
807
  setSrc(URL.createObjectURL(file2));
809
808
  }).catch((reason) => {
810
809
  console.error(`Failed to fetch file ${file} (${fileSha1}):
@@ -2520,7 +2519,7 @@ const projectFileSlice = createSlice({
2520
2519
  extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$6)),
2521
2520
  reducers: {
2522
2521
  addOrReplaceProjectFiles: (state, action) => {
2523
- for (const fileObj of action.payload) {
2522
+ for (let fileObj of action.payload) {
2524
2523
  let file = fileObj.file;
2525
2524
  if (file.includes("+")) {
2526
2525
  console.warn("Attempting to apply fix for image URL with '+' character:", file);
@@ -2531,6 +2530,7 @@ const projectFileSlice = createSlice({
2531
2530
  const lastPart = encodeURIComponent(parts[parts.length - 1]);
2532
2531
  file = parts.slice(0, -1).join("/") + "/" + lastPart;
2533
2532
  console.warn("Fixed URL:", file);
2533
+ fileObj = { ...fileObj, file };
2534
2534
  }
2535
2535
  state.projectFiles[fileObj.offline_id] = fileObj;
2536
2536
  }