Skip to content

Commit

Permalink
perf: don't re-render on every window resize
Browse files Browse the repository at this point in the history
  • Loading branch information
WofWca committed Jan 8, 2025
1 parent f90844a commit 7dd1729
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
- fix reactions to sticker messages overlapping with next message #4433
- fix: "Enter" not adding the first contact in "Add Members" dialog #4439
- fix: devmode: fix logging and counting jsonrpc requests #4458
- performance: don't re-render every time the window is resized #4460

## [1.50.1] - 2024-12-18

Expand Down
5 changes: 4 additions & 1 deletion packages/frontend/src/ScreenController.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,10 @@ export default class ScreenController extends Component {
}

updateSmallScreenMode() {
this.setState({ smallScreenMode: isSmallScreenMode() })
const newIsSmallScreen = isSmallScreenMode()
if (this.state.smallScreenMode !== newIsSmallScreen) {
this.setState({ smallScreenMode: newIsSmallScreen })
}
}

componentDidMount() {
Expand Down

0 comments on commit 7dd1729

Please sign in to comment.