3DStreet / 3dstreet-editor

3DStreet Editor Repo
https://3dstreet.app
Other
19 stars 3 forks source link

after saving new scene title in open browser, show new title #322

Closed kfarr closed 11 months ago

kfarr commented 11 months ago

split into new ticket from https://github.com/3DStreet/3dstreet-editor/pull/312

issue: right now the updated title doesn't show, even though it does updated successfully on the server. This confuses user after renaming a scene and seeing a success message that it was updated on the server.

Instead: after successful saving of new scene title in the open modal, new title should show immediately (or show spinner and reload)

I tried a hack like this, but it did not work for some reason:

      // Update the local scenesData to reflect the title change
      console.log("THIS HAHPPEPEND")
      // Update the local scenesData to reflect the title change
      let updatedScenes = [...scenesData];
      const sceneIndex = updatedScenes.findIndex(s => s.id === scene.id);
      if (sceneIndex !== -1) {
        // If scenesData contains objects with a data method, modify the following line accordingly.
        updatedScenes[sceneIndex].data().title = editInputValue;
      }
      setScenesData(updatedScenes);