From df706737f05689a4ca64c5e537790c3caaa17439 Mon Sep 17 00:00:00 2001 From: Etotaziba Olei Date: Tue, 5 Nov 2024 11:08:12 +0100 Subject: [PATCH 1/7] fix window dimensions --- src/hooks/useWindowDimensions/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hooks/useWindowDimensions/index.ts b/src/hooks/useWindowDimensions/index.ts index 4997fc4b01a7..a1bea6a80644 100644 --- a/src/hooks/useWindowDimensions/index.ts +++ b/src/hooks/useWindowDimensions/index.ts @@ -130,7 +130,7 @@ export default function (useCachedViewportHeight = false): WindowDimensions { const didScreenReturnToOriginalSize = lockedWindowDimensionsRef.current.windowWidth === windowWidth && lockedWindowDimensionsRef.current.windowHeight === windowHeight; // if video exits fullscreen mode, unlock the window dimensions - if (lockedWindowDimensionsRef.current && !isFullScreenRef.current && didScreenReturnToOriginalSize) { + if (lockedWindowDimensionsRef.current && !isFullScreenRef.current) { const lastLockedWindowDimensions = {...lockedWindowDimensionsRef.current}; unlockWindowDimensions(); return {windowWidth: lastLockedWindowDimensions.windowWidth, windowHeight: lastLockedWindowDimensions.windowHeight}; From 9e37309782b252f70c289e98090b13d5afe1422e Mon Sep 17 00:00:00 2001 From: Etotaziba Olei Date: Tue, 5 Nov 2024 11:22:25 +0100 Subject: [PATCH 2/7] fix lint --- src/hooks/useWindowDimensions/index.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/hooks/useWindowDimensions/index.ts b/src/hooks/useWindowDimensions/index.ts index a1bea6a80644..6e7b74bf8df5 100644 --- a/src/hooks/useWindowDimensions/index.ts +++ b/src/hooks/useWindowDimensions/index.ts @@ -127,8 +127,6 @@ export default function (useCachedViewportHeight = false): WindowDimensions { return windowDimensions; } - const didScreenReturnToOriginalSize = lockedWindowDimensionsRef.current.windowWidth === windowWidth && lockedWindowDimensionsRef.current.windowHeight === windowHeight; - // if video exits fullscreen mode, unlock the window dimensions if (lockedWindowDimensionsRef.current && !isFullScreenRef.current) { const lastLockedWindowDimensions = {...lockedWindowDimensionsRef.current}; From 62cd803d4e4afeacb9bf5d4f4035fcefd533bbbb Mon Sep 17 00:00:00 2001 From: Etotaziba Olei Date: Wed, 6 Nov 2024 08:28:20 +0100 Subject: [PATCH 3/7] call onHideCallback directly. --- src/pages/home/report/ContextMenu/ReportActionContextMenu.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/pages/home/report/ContextMenu/ReportActionContextMenu.ts b/src/pages/home/report/ContextMenu/ReportActionContextMenu.ts index df500a967cfd..df1f2cd5c9b8 100644 --- a/src/pages/home/report/ContextMenu/ReportActionContextMenu.ts +++ b/src/pages/home/report/ContextMenu/ReportActionContextMenu.ts @@ -64,8 +64,7 @@ function hideContextMenu(shouldDelay?: boolean, onHideCallback = () => {}) { return; } if (!shouldDelay) { - contextMenuRef.current.hideContextMenu(onHideCallback); - + onHideCallback(); return; } From 36a05508d77891d00ceccfaf73bf0290a1e47753 Mon Sep 17 00:00:00 2001 From: Etotaziba Olei Date: Wed, 6 Nov 2024 08:30:20 +0100 Subject: [PATCH 4/7] undo windowDimensions changes --- src/hooks/useWindowDimensions/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/hooks/useWindowDimensions/index.ts b/src/hooks/useWindowDimensions/index.ts index 6e7b74bf8df5..4997fc4b01a7 100644 --- a/src/hooks/useWindowDimensions/index.ts +++ b/src/hooks/useWindowDimensions/index.ts @@ -127,8 +127,10 @@ export default function (useCachedViewportHeight = false): WindowDimensions { return windowDimensions; } + const didScreenReturnToOriginalSize = lockedWindowDimensionsRef.current.windowWidth === windowWidth && lockedWindowDimensionsRef.current.windowHeight === windowHeight; + // if video exits fullscreen mode, unlock the window dimensions - if (lockedWindowDimensionsRef.current && !isFullScreenRef.current) { + if (lockedWindowDimensionsRef.current && !isFullScreenRef.current && didScreenReturnToOriginalSize) { const lastLockedWindowDimensions = {...lockedWindowDimensionsRef.current}; unlockWindowDimensions(); return {windowWidth: lastLockedWindowDimensions.windowWidth, windowHeight: lastLockedWindowDimensions.windowHeight}; From f3d0eba2d62fce74398d2325d4c28e57b0b84251 Mon Sep 17 00:00:00 2001 From: Etotaziba Olei Date: Thu, 14 Nov 2024 05:24:29 +0100 Subject: [PATCH 5/7] remove useless didScreenReturnToOriginalSize --- src/pages/home/report/ContextMenu/ReportActionContextMenu.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/home/report/ContextMenu/ReportActionContextMenu.ts b/src/pages/home/report/ContextMenu/ReportActionContextMenu.ts index df1f2cd5c9b8..bda7bb11a91a 100644 --- a/src/pages/home/report/ContextMenu/ReportActionContextMenu.ts +++ b/src/pages/home/report/ContextMenu/ReportActionContextMenu.ts @@ -64,7 +64,7 @@ function hideContextMenu(shouldDelay?: boolean, onHideCallback = () => {}) { return; } if (!shouldDelay) { - onHideCallback(); + contextMenuRef.current.hideContextMenu(onHideCallback); return; } From 91d791bde3a602d7f8eea68ad99ab0837dab0607 Mon Sep 17 00:00:00 2001 From: Etotaziba Olei Date: Thu, 14 Nov 2024 05:49:12 +0100 Subject: [PATCH 6/7] remove useless didScreenReturnToOriginalSize --- src/hooks/useWindowDimensions/index.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/hooks/useWindowDimensions/index.ts b/src/hooks/useWindowDimensions/index.ts index 4997fc4b01a7..6e7b74bf8df5 100644 --- a/src/hooks/useWindowDimensions/index.ts +++ b/src/hooks/useWindowDimensions/index.ts @@ -127,10 +127,8 @@ export default function (useCachedViewportHeight = false): WindowDimensions { return windowDimensions; } - const didScreenReturnToOriginalSize = lockedWindowDimensionsRef.current.windowWidth === windowWidth && lockedWindowDimensionsRef.current.windowHeight === windowHeight; - // if video exits fullscreen mode, unlock the window dimensions - if (lockedWindowDimensionsRef.current && !isFullScreenRef.current && didScreenReturnToOriginalSize) { + if (lockedWindowDimensionsRef.current && !isFullScreenRef.current) { const lastLockedWindowDimensions = {...lockedWindowDimensionsRef.current}; unlockWindowDimensions(); return {windowWidth: lastLockedWindowDimensions.windowWidth, windowHeight: lastLockedWindowDimensions.windowHeight}; From ec64bcab75c7ba5fdf47f4fa384c4b3f9b69472a Mon Sep 17 00:00:00 2001 From: Etotaziba Olei Date: Thu, 14 Nov 2024 05:54:51 +0100 Subject: [PATCH 7/7] fix context menu double call --- src/pages/home/report/ContextMenu/ReportActionContextMenu.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/home/report/ContextMenu/ReportActionContextMenu.ts b/src/pages/home/report/ContextMenu/ReportActionContextMenu.ts index bda7bb11a91a..df1f2cd5c9b8 100644 --- a/src/pages/home/report/ContextMenu/ReportActionContextMenu.ts +++ b/src/pages/home/report/ContextMenu/ReportActionContextMenu.ts @@ -64,7 +64,7 @@ function hideContextMenu(shouldDelay?: boolean, onHideCallback = () => {}) { return; } if (!shouldDelay) { - contextMenuRef.current.hideContextMenu(onHideCallback); + onHideCallback(); return; }