3DStreet / 3dstreet-editor

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

sharing url does not work in some cases #357

Closed kfarr closed 9 months ago

kfarr commented 9 months ago

Instead, the share dialog should always show the doc id (uuid) of the street

Refer to recent improvements in save handling that leverage the scene metadata component for scene id and title state management: https://github.com/3DStreet/3dstreet-editor/commit/26539bb28c0bdf7343a28e20bfea7ec33f168024#diff-3ca8a64d250a8f7449f132f6fac892d85418d0d3a642f95ca46fcbd69b6ab65cR10

Suggested fix around this location https://github.com/3DStreet/3dstreet-editor/blob/master/src/components/modals/ScreenshotModal/ScreenshotModal.component.jsx#L110

replace this: const currentUrl = window.location.href;

with something similar to:

  const sceneId = STREET.utils.getCurrentSceneId();
  const sceneURL = 'https://3dstreet.app/#/scenes/' + sceneId + '.json';

also if statement? like if there is no sceneId then revert to window.location.href ?

image