mirror of
https://github.com/stoatchat/for-legacy-web.git
synced 2026-03-07 09:25:27 +00:00
Temporary blocked messages solution.
Fix settings theme colour.
This commit is contained in:
@@ -94,16 +94,6 @@ export function MessageArea({ id }: Props) {
|
||||
setScrollState({ type: "Free" });
|
||||
}
|
||||
});
|
||||
|
||||
/*if (v.type === 'StayAtBottom') {
|
||||
if (scrollState.current.type === 'Bottom' || atBottom()) {
|
||||
scrollState.current = { type: 'ScrollToBottom', smooth: v.smooth };
|
||||
} else {
|
||||
scrollState.current = { type: 'Free' };
|
||||
}
|
||||
} else {
|
||||
scrollState.current = v;
|
||||
}*/
|
||||
}
|
||||
|
||||
// ? Determine if we are at the bottom of the scroll container.
|
||||
@@ -153,40 +143,6 @@ export function MessageArea({ id }: Props) {
|
||||
}
|
||||
}, [ status, state ]);
|
||||
|
||||
// ? Scroll to the bottom before the browser paints.
|
||||
useLayoutEffect(() => {
|
||||
// ! FIXME: NO REACTIVITY
|
||||
if (scrollState.current.type === "ScrollToBottom") {
|
||||
setScrollState({ type: "Bottom", scrollingUntil: + new Date() + 150 });
|
||||
|
||||
animateScroll.scrollToBottom({
|
||||
container: ref.current,
|
||||
duration: scrollState.current.smooth ? 150 : 0
|
||||
});
|
||||
} else if (scrollState.current.type === "OffsetTop") {
|
||||
animateScroll.scrollTo(
|
||||
Math.max(
|
||||
101,
|
||||
ref.current.scrollTop +
|
||||
(ref.current.scrollHeight - scrollState.current.previousHeight)
|
||||
),
|
||||
{
|
||||
container: ref.current,
|
||||
duration: 0
|
||||
}
|
||||
);
|
||||
|
||||
setScrollState({ type: "Free" });
|
||||
} else if (scrollState.current.type === "ScrollTop") {
|
||||
animateScroll.scrollTo(scrollState.current.y, {
|
||||
container: ref.current,
|
||||
duration: 0
|
||||
});
|
||||
|
||||
setScrollState({ type: "Free" });
|
||||
}
|
||||
}, [scrollState]);
|
||||
|
||||
// ? When the container is scrolled.
|
||||
// ? Also handle StayAtBottom
|
||||
useEffect(() => {
|
||||
|
||||
Reference in New Issue
Block a user