door_models 5.3.3 → 5.3.4
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/index.cjs.js +19 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +19 -1
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -1920,7 +1920,8 @@ function DoorLeaf(_ref8) {
|
|
|
1920
1920
|
doorWidth,
|
|
1921
1921
|
doorHeight,
|
|
1922
1922
|
theDoorDepth,
|
|
1923
|
-
doorOpening
|
|
1923
|
+
doorOpening,
|
|
1924
|
+
doorName
|
|
1924
1925
|
} = door;
|
|
1925
1926
|
const {
|
|
1926
1927
|
frameDepth,
|
|
@@ -1934,6 +1935,23 @@ function DoorLeaf(_ref8) {
|
|
|
1934
1935
|
secondDoorStopDepth
|
|
1935
1936
|
} = doorFrame;
|
|
1936
1937
|
const initialDoorHeight = React.useRef(null);
|
|
1938
|
+
React.useEffect(() => {
|
|
1939
|
+
initialDoorHeight.current = null;
|
|
1940
|
+
}, [doorName]);
|
|
1941
|
+
React.useEffect(() => {
|
|
1942
|
+
if (initialDoorHeight.current === null && doorHeight > 0) {
|
|
1943
|
+
initialDoorHeight.current = doorHeight;
|
|
1944
|
+
}
|
|
1945
|
+
}, [doorHeight]);
|
|
1946
|
+
React.useMemo(() => {
|
|
1947
|
+
if (initialDoorHeight.current === null) {
|
|
1948
|
+
return 0;
|
|
1949
|
+
}
|
|
1950
|
+
return (doorHeight - initialDoorHeight.current) / 2 / 1000;
|
|
1951
|
+
}, [doorHeight]);
|
|
1952
|
+
|
|
1953
|
+
// Old
|
|
1954
|
+
|
|
1937
1955
|
React.useEffect(() => {
|
|
1938
1956
|
if (doorHeight > 0 && initialDoorHeight.current === null) {
|
|
1939
1957
|
initialDoorHeight.current = doorHeight;
|