@reearth/core 0.0.7-alpha.26 → 0.0.7-alpha.28

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reearth/core",
3
- "version": "0.0.7-alpha.26",
3
+ "version": "0.0.7-alpha.28",
4
4
  "author": "Re:Earth contributors <community@reearth.io>",
5
5
  "license": "Apache-2.0",
6
6
  "description": "A library that abstracts a map engine as one common API.",
@@ -385,13 +385,9 @@ export default function ({
385
385
  interactionModeRef.current = interactionMode;
386
386
 
387
387
  useEffect(() => {
388
- overrideInteractionModeRef.current?.(
389
- type || sketchEditingFeature
390
- ? "sketch"
391
- : interactionModeRef.current === "sketch"
392
- ? "default"
393
- : interactionModeRef.current,
394
- );
388
+ if ((sketchEditingFeature || type) && interactionModeRef.current !== "sketch") {
389
+ overrideInteractionModeRef.current?.("sketch");
390
+ }
395
391
  }, [type, sketchEditingFeature]);
396
392
 
397
393
  const isEditingRef = useRef(isEditing);
@@ -404,6 +400,11 @@ export default function ({
404
400
  if (isEditingRef.current) {
405
401
  cancelEditRef.current();
406
402
  }
403
+ if (type === undefined) {
404
+ overrideInteractionModeRef.current?.(
405
+ interactionModeRef.current === "sketch" ? "default" : interactionModeRef.current,
406
+ );
407
+ }
407
408
  }, [type]);
408
409
 
409
410
  const typeRef = useRef(type);
@@ -413,8 +414,6 @@ export default function ({
413
414
  if (interactionMode !== "sketch") {
414
415
  if (isEditingRef.current) {
415
416
  cancelEditRef.current();
416
- } else if (typeRef.current !== undefined) {
417
- updateType(undefined);
418
417
  }
419
418
  }
420
419
  }, [interactionMode, updateType]);