@reearth/core 0.0.7-alpha.26 → 0.0.7-alpha.27
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/dist/core.js +589 -592
- package/dist/core.umd.cjs +23 -23
- package/package.json +1 -1
- package/src/Map/Sketch/hooks.ts +6 -9
package/package.json
CHANGED
package/src/Map/Sketch/hooks.ts
CHANGED
|
@@ -385,13 +385,9 @@ export default function ({
|
|
|
385
385
|
interactionModeRef.current = interactionMode;
|
|
386
386
|
|
|
387
387
|
useEffect(() => {
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
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,9 @@ export default function ({
|
|
|
404
400
|
if (isEditingRef.current) {
|
|
405
401
|
cancelEditRef.current();
|
|
406
402
|
}
|
|
403
|
+
if (type === undefined) {
|
|
404
|
+
overrideInteractionModeRef.current?.("default");
|
|
405
|
+
}
|
|
407
406
|
}, [type]);
|
|
408
407
|
|
|
409
408
|
const typeRef = useRef(type);
|
|
@@ -413,8 +412,6 @@ export default function ({
|
|
|
413
412
|
if (interactionMode !== "sketch") {
|
|
414
413
|
if (isEditingRef.current) {
|
|
415
414
|
cancelEditRef.current();
|
|
416
|
-
} else if (typeRef.current !== undefined) {
|
|
417
|
-
updateType(undefined);
|
|
418
415
|
}
|
|
419
416
|
}
|
|
420
417
|
}, [interactionMode, updateType]);
|