diff --git a/net/web/src/context/useCardContext.hook.js b/net/web/src/context/useCardContext.hook.js index fff51706..984b7d82 100644 --- a/net/web/src/context/useCardContext.hook.js +++ b/net/web/src/context/useCardContext.hook.js @@ -282,12 +282,26 @@ export function useCardContext() { let token = cardProfile.guid + '.' + cardDetail.token; let node = cardProfile.node; await removeContactChannelTopic(node, token, channelId, topicId); + try { + resync.current.push(cardId); + await setCards(null); + } + catch (err) { + console.log(err); + } }, setChannelTopicSubject: async (cardId, channelId, topicId, data) => { let { cardProfile, cardDetail } = cards.current.get(cardId).data; let token = cardProfile.guid + '.' + cardDetail.token; let node = cardProfile.node; await setContactChannelTopicSubject(node, token, channelId, topicId, data); + try { + resync.current.push(cardId); + await setCards(null); + } + catch (err) { + console.log(err); + } }, addChannelTopic: async (cardId, channelId, message, files) => { let { cardProfile, cardDetail } = cards.current.get(cardId).data; diff --git a/net/web/src/context/useChannelContext.hook.js b/net/web/src/context/useChannelContext.hook.js index 90fe4628..efa5a298 100644 --- a/net/web/src/context/useChannelContext.hook.js +++ b/net/web/src/context/useChannelContext.hook.js @@ -120,10 +120,22 @@ export function useChannelContext() { return await removeChannel(access.current, channelId); }, removeChannelTopic: async (channelId, topicId) => { - return await removeChannelTopic(access.current, channelId, topicId); + await removeChannelTopic(access.current, channelId, topicId); + try { + await setChannels(null); + } + catch (err) { + console.log(err); + } }, setChannelTopicSubject: async (channelId, topicId, data) => { - return await setChannelTopicSubject(access.current, channelId, topicId, data); + await setChannelTopicSubject(access.current, channelId, topicId, data); + try { + await setChannels(null); + } + catch (err) { + console.log(err); + } }, addChannelTopic: async (channelId, message, files) => { if (files?.length) { diff --git a/net/web/src/context/useConversationContext.hook.js b/net/web/src/context/useConversationContext.hook.js index f41d551e..712e4368 100644 --- a/net/web/src/context/useConversationContext.hook.js +++ b/net/web/src/context/useConversationContext.hook.js @@ -201,7 +201,9 @@ export function useConversationContext() { let subject = getSubject(chan); let contacts = getContacts(chan); let members = getMembers(chan); - const { enableImage, enableAudio, enableVideo } = chan.data.channelDetail; + const enableImage = chan?.data?.channelDetail?.enableImage; + const enableAudio = chan?.data?.channelDetail?.enableAudio; + const enableVideo = chan?.data?.channelDetail?.enableVideo; updateState({ init: true, error: false, diff --git a/net/web/src/session/conversation/virtualList/VirtualList.jsx b/net/web/src/session/conversation/virtualList/VirtualList.jsx index 7a5c6adc..2c489f3b 100644 --- a/net/web/src/session/conversation/virtualList/VirtualList.jsx +++ b/net/web/src/session/conversation/virtualList/VirtualList.jsx @@ -192,7 +192,7 @@ export function VirtualList({ id, items, itemRenderer, loadMore }) { for (let i = 1; i < containers.current.length; i++) { let container = containers.current[i]; if (container.index != index + i) { - const item = itemView.current[index + 1]; + const item = itemView.current[index + i]; let slot = { top: container.top - defaultHeight, height: defaultHeight,