fixing topic update issues

This commit is contained in:
Roland Osborne 2022-09-01 12:03:42 -07:00
parent cef54de9fe
commit f51ed1563f
4 changed files with 32 additions and 4 deletions

View File

@ -282,12 +282,26 @@ export function useCardContext() {
let token = cardProfile.guid + '.' + cardDetail.token; let token = cardProfile.guid + '.' + cardDetail.token;
let node = cardProfile.node; let node = cardProfile.node;
await removeContactChannelTopic(node, token, channelId, topicId); 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) => { setChannelTopicSubject: async (cardId, channelId, topicId, data) => {
let { cardProfile, cardDetail } = cards.current.get(cardId).data; let { cardProfile, cardDetail } = cards.current.get(cardId).data;
let token = cardProfile.guid + '.' + cardDetail.token; let token = cardProfile.guid + '.' + cardDetail.token;
let node = cardProfile.node; let node = cardProfile.node;
await setContactChannelTopicSubject(node, token, channelId, topicId, data); 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) => { addChannelTopic: async (cardId, channelId, message, files) => {
let { cardProfile, cardDetail } = cards.current.get(cardId).data; let { cardProfile, cardDetail } = cards.current.get(cardId).data;

View File

@ -120,10 +120,22 @@ export function useChannelContext() {
return await removeChannel(access.current, channelId); return await removeChannel(access.current, channelId);
}, },
removeChannelTopic: async (channelId, topicId) => { 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) => { 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) => { addChannelTopic: async (channelId, message, files) => {
if (files?.length) { if (files?.length) {

View File

@ -201,7 +201,9 @@ export function useConversationContext() {
let subject = getSubject(chan); let subject = getSubject(chan);
let contacts = getContacts(chan); let contacts = getContacts(chan);
let members = getMembers(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({ updateState({
init: true, init: true,
error: false, error: false,

View File

@ -192,7 +192,7 @@ export function VirtualList({ id, items, itemRenderer, loadMore }) {
for (let i = 1; i < containers.current.length; i++) { for (let i = 1; i < containers.current.length; i++) {
let container = containers.current[i]; let container = containers.current[i];
if (container.index != index + i) { if (container.index != index + i) {
const item = itemView.current[index + 1]; const item = itemView.current[index + i];
let slot = { let slot = {
top: container.top - defaultHeight, top: container.top - defaultHeight,
height: defaultHeight, height: defaultHeight,