From 14fc1481f37579758f8a913005e0cb0c290bfb0b Mon Sep 17 00:00:00 2001 From: Robin Date: Fri, 12 Jul 2024 14:01:32 -0400 Subject: [PATCH] Address some review feedback --- src/Header.module.css | 2 +- src/Header.tsx | 2 +- src/grid/LegacyGrid.module.css | 2 +- src/grid/LegacyGrid.tsx | 2 +- src/grid/TileWrapper.tsx | 2 +- src/room/InCallView.tsx | 4 ++-- src/room/VideoPreview.tsx | 2 +- src/useReactiveState.ts | 3 ++- test/grid/LegacyGrid-test.ts | 2 +- 9 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/Header.module.css b/src/Header.module.css index 6aa609f7..4e54009d 100644 --- a/src/Header.module.css +++ b/src/Header.module.css @@ -1,5 +1,5 @@ /* -Copyright 2022 New Vector Ltd +Copyright 2022-2024 New Vector Ltd Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/src/Header.tsx b/src/Header.tsx index ffb4731e..e0fb9297 100644 --- a/src/Header.tsx +++ b/src/Header.tsx @@ -1,5 +1,5 @@ /* -Copyright 2022 New Vector Ltd +Copyright 2022-2024 New Vector Ltd Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/src/grid/LegacyGrid.module.css b/src/grid/LegacyGrid.module.css index 6e59e66e..cad3e3c4 100644 --- a/src/grid/LegacyGrid.module.css +++ b/src/grid/LegacyGrid.module.css @@ -1,5 +1,5 @@ /* -Copyright 2022 New Vector Ltd +Copyright 2022-2024 New Vector Ltd Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/src/grid/LegacyGrid.tsx b/src/grid/LegacyGrid.tsx index 9e1fb876..f04cde78 100644 --- a/src/grid/LegacyGrid.tsx +++ b/src/grid/LegacyGrid.tsx @@ -1,5 +1,5 @@ /* -Copyright 2022-2023 New Vector Ltd +Copyright 2022-2024 New Vector Ltd Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/src/grid/TileWrapper.tsx b/src/grid/TileWrapper.tsx index ded2be28..dcb8e908 100644 --- a/src/grid/TileWrapper.tsx +++ b/src/grid/TileWrapper.tsx @@ -1,5 +1,5 @@ /* -Copyright 2023 New Vector Ltd +Copyright 2023-2024 New Vector Ltd Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/src/room/InCallView.tsx b/src/room/InCallView.tsx index 4407de38..1ccdb2ec 100644 --- a/src/room/InCallView.tsx +++ b/src/room/InCallView.tsx @@ -1,5 +1,5 @@ /* -Copyright 2022 - 2023 New Vector Ltd +Copyright 2022 - 2024 New Vector Ltd Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -266,7 +266,7 @@ export const InCallView: FC = subscribe( // useFullscreen so that we can control the fullscreen state of the // spotlight tile in the new layouts with this same hook. const fullscreenItems = useMemo( - () => [...items, ...(hasSpotlight ? [dummySpotlightItem] : [])], + () => (hasSpotlight ? [...items, dummySpotlightItem] : items), [items, hasSpotlight], ); const { fullscreenItem, toggleFullscreen, exitFullscreen } = diff --git a/src/room/VideoPreview.tsx b/src/room/VideoPreview.tsx index dd98421e..3be88f1f 100644 --- a/src/room/VideoPreview.tsx +++ b/src/room/VideoPreview.tsx @@ -1,5 +1,5 @@ /* -Copyright 2022 - 2023 New Vector Ltd +Copyright 2022 - 2024 New Vector Ltd Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/src/useReactiveState.ts b/src/useReactiveState.ts index af18e84b..afd509fb 100644 --- a/src/useReactiveState.ts +++ b/src/useReactiveState.ts @@ -1,5 +1,5 @@ /* -Copyright 2023 New Vector Ltd +Copyright 2023-2024 New Vector Ltd Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -44,6 +44,7 @@ export const useReactiveState = ( if ( prevDeps.current === undefined || deps.length !== prevDeps.current.length || + // Deps might be NaN, so we compare with Object.is rather than === deps.some((d, i) => !Object.is(d, prevDeps.current![i])) ) { state.current = updateFn(state.current); diff --git a/test/grid/LegacyGrid-test.ts b/test/grid/LegacyGrid-test.ts index 44f82d42..e57adf9d 100644 --- a/test/grid/LegacyGrid-test.ts +++ b/test/grid/LegacyGrid-test.ts @@ -1,5 +1,5 @@ /* -Copyright 2023 New Vector Ltd +Copyright 2023-2024 New Vector Ltd Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.