mirror of
https://github.com/balzack/databag.git
synced 2025-02-12 03:29:16 +00:00
reset list of conversation switch
This commit is contained in:
parent
764c777c0c
commit
8cf1d2f24b
@ -25,7 +25,8 @@ export function Conversation() {
|
||||
onClick={() => actions.close()} icon={<CloseOutlined />} />
|
||||
</div>
|
||||
<div class="thread">
|
||||
<VirtualList items={state.topics} itemRenderer={topicRenderer} />
|
||||
<VirtualList id={state.channelId + state.cardId}
|
||||
items={state.topics} itemRenderer={topicRenderer} />
|
||||
<BusySpin size="large" delay="1000" spinning={!state.init} />
|
||||
</div>
|
||||
<AddTopic />
|
||||
|
@ -21,7 +21,7 @@ export function VirtualList({ id, items, itemRenderer }) {
|
||||
let containers = useRef([]);
|
||||
let anchorBottom = useRef(true);
|
||||
let listRef = useRef();
|
||||
let view = useRef(null);
|
||||
let key = useRef(null);
|
||||
|
||||
const addSlot = (id, slot) => {
|
||||
setSlots((m) => { m.set(id, slot); return new Map(m); })
|
||||
@ -36,7 +36,7 @@ export function VirtualList({ id, items, itemRenderer }) {
|
||||
}
|
||||
|
||||
const clearSlots = () => {
|
||||
setSlots((m) => { new Map() })
|
||||
setSlots((m) => { return new Map() })
|
||||
}
|
||||
|
||||
const growCanvasHeight = (val) => {
|
||||
@ -56,8 +56,8 @@ export function VirtualList({ id, items, itemRenderer }) {
|
||||
}, [viewHeight]);
|
||||
|
||||
useEffect(() => {
|
||||
if (view.current != id) {
|
||||
view.current = id;
|
||||
if (key.current != id) {
|
||||
key.current = id;
|
||||
latch.current = true;
|
||||
containers.current = [];
|
||||
anchorBottom.current = true;
|
||||
|
Loading…
Reference in New Issue
Block a user