clear remote channels from disconnecting contacts

This commit is contained in:
balzack 2022-11-16 09:50:42 -08:00
parent d914de9e00
commit f991db4e30

View File

@ -263,7 +263,6 @@ export function useCardContext() {
await syncCard(card);
}
else {
//TODO clear card channel topics
await store.actions.clearCardChannelItems(guid, card.id);
await store.actions.clearCardItem(guid, card.id);
cards.current.delete(card.id);
@ -312,7 +311,7 @@ export function useCardContext() {
await updateCardChannelItems(card.id, cardServer, cardToken, notifiedView, null);
await store.actions.setCardItemNotifiedChannel(guid, card.id, notifiedChannel);
await store.actions.setCardItemNotifiedView(guid, card.id, notifiedView);
clearCardChannel(card.id);
clearCardChannels(card.id);
}
else {
if (status.notifiedChannel != notifiedChannel) {
@ -336,6 +335,10 @@ export function useCardContext() {
setCardOffsync(card.id, 1);
}
}
else {
await store.actions.clearCardChannelItems(guid, card.id);
clearCardChannels(card.id);
}
}
const updateCardChannelItems = async (cardId, cardServer, cardToken, notifiedView, notifiedChannel) => {