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

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.
@@ -2520,8 +2520,19 @@ const projectFileSlice = createSlice({
2520
2520
  extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$6)),
2521
2521
  reducers: {
2522
2522
  addOrReplaceProjectFiles: (state, action) => {
2523
- for (const file of action.payload) {
2524
- state.projectFiles[file.offline_id] = file;
2523
+ for (const fileObj of action.payload) {
2524
+ let file = fileObj.file;
2525
+ if (file.includes("+")) {
2526
+ console.warn("Attempting to apply fix for image URL with '+' character:", file);
2527
+ const parts = file.split("/");
2528
+ if (parts.length < 2) {
2529
+ throw new Error("Invalid URL: " + file);
2530
+ }
2531
+ const lastPart = encodeURIComponent(parts[parts.length - 1]);
2532
+ file = parts.slice(0, -1).join("/") + "/" + lastPart;
2533
+ console.warn("Fixed URL:", file);
2534
+ }
2535
+ state.projectFiles[fileObj.offline_id] = fileObj;
2525
2536
  }
2526
2537
  },
2527
2538
  addOrReplaceProjectFile: (state, action) => {