fix(SW-203): added translations and now using updater function to set state
This commit is contained in:
@@ -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 (
|
||||
|
||||
Reference in New Issue
Block a user