mirror of
https://github.com/balzack/databag.git
synced 2025-02-14 12:39:17 +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 />} />
|
onClick={() => actions.close()} icon={<CloseOutlined />} />
|
||||||
</div>
|
</div>
|
||||||
<div class="thread">
|
<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} />
|
<BusySpin size="large" delay="1000" spinning={!state.init} />
|
||||||
</div>
|
</div>
|
||||||
<AddTopic />
|
<AddTopic />
|
||||||
|
@ -21,7 +21,7 @@ export function VirtualList({ id, items, itemRenderer }) {
|
|||||||
let containers = useRef([]);
|
let containers = useRef([]);
|
||||||
let anchorBottom = useRef(true);
|
let anchorBottom = useRef(true);
|
||||||
let listRef = useRef();
|
let listRef = useRef();
|
||||||
let view = useRef(null);
|
let key = useRef(null);
|
||||||
|
|
||||||
const addSlot = (id, slot) => {
|
const addSlot = (id, slot) => {
|
||||||
setSlots((m) => { m.set(id, slot); return new Map(m); })
|
setSlots((m) => { m.set(id, slot); return new Map(m); })
|
||||||
@ -36,7 +36,7 @@ export function VirtualList({ id, items, itemRenderer }) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const clearSlots = () => {
|
const clearSlots = () => {
|
||||||
setSlots((m) => { new Map() })
|
setSlots((m) => { return new Map() })
|
||||||
}
|
}
|
||||||
|
|
||||||
const growCanvasHeight = (val) => {
|
const growCanvasHeight = (val) => {
|
||||||
@ -56,8 +56,8 @@ export function VirtualList({ id, items, itemRenderer }) {
|
|||||||
}, [viewHeight]);
|
}, [viewHeight]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (view.current != id) {
|
if (key.current != id) {
|
||||||
view.current = id;
|
key.current = id;
|
||||||
latch.current = true;
|
latch.current = true;
|
||||||
containers.current = [];
|
containers.current = [];
|
||||||
anchorBottom.current = true;
|
anchorBottom.current = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user