Skip to content

Commit

Permalink
🐛 fix: slove some time was shaking
Browse files Browse the repository at this point in the history
  • Loading branch information
ONLY-yours committed Jun 18, 2024
1 parent 5ff3b89 commit dca42df
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/ProChat/container/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,12 @@ const App = memo<ConversationProps>(
return (
<RcResizeObserver
onResize={(e) => {
if (e.height !== height) {
if (
typeof height !== typeof e.height ||
(typeof height === 'string' && typeof e.height === 'string' && e.height !== height) ||
(typeof height === 'number' && Math.abs(e.height - height) > 1)
) {
// stop shaking
setHeight(e.height);
}
}}
Expand Down

0 comments on commit dca42df

Please sign in to comment.