Chat: Handle "Cannot read property style of null" exception (#1203)
This commit is contained in:
parent
65f583a8ec
commit
479138c264
@ -123,12 +123,12 @@ const Chat: FC<OwnProps & StateProps & DispatchProps> = ({
|
||||
|
||||
// Sets animation excess values when `orderDiff` changes and then resets excess values to animate.
|
||||
useLayoutEffect(() => {
|
||||
if (animationLevel === 0) {
|
||||
const element = ref.current;
|
||||
|
||||
if (animationLevel === 0 || !element) {
|
||||
return;
|
||||
}
|
||||
|
||||
const element = ref.current!;
|
||||
|
||||
// TODO Refactor animation: create `useListAnimation` that owns `orderDiff` and `animationType`
|
||||
if (animationType === ChatAnimationTypes.Opacity) {
|
||||
element.style.opacity = '0';
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user