fix(SW-203): added translations and now using updater function to set state

This commit is contained in:
Erik Tiekstra
2024-08-14 09:36:58 +02:00
parent 2d791557b7
commit 0a2fb14383
6 changed files with 9 additions and 4 deletions

View File

@@ -41,11 +41,11 @@ export function Rooms({ rooms }: RoomsProps) {
.sort((a, b) => a.sortOrder - b.sortOrder)
function handleToggleShowMore() {
const newState = !allRoomsVisible
setAllRoomsVisible(newState)
if (scrollRef.current && !newState) {
if (scrollRef.current && allRoomsVisible) {
scrollRef.current.scrollIntoView({ behavior: "smooth" })
}
setAllRoomsVisible((previousState) => !previousState)
}
return (