@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/dist/core.js +591 -591
- package/dist/core.umd.cjs +23 -23
- package/package.json +1 -1
- package/src/Map/Sketch/hooks.ts +8 -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,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]);
|