mirror of
https://github.com/balzack/databag.git
synced 2025-02-12 03:29:16 +00:00
merging back topic alerts
This commit is contained in:
parent
ace042bf0c
commit
e57fb1b91d
@ -245,11 +245,11 @@ export function useChannelContext() {
|
|||||||
},
|
},
|
||||||
setTopicFlag: async (channelId, topicId) => {
|
setTopicFlag: async (channelId, topicId) => {
|
||||||
const { guid } = access.current;
|
const { guid } = access.current;
|
||||||
await store.actions.setChannelTopicBlocked(guid, channelId, topicId, true);
|
await store.actions.setChannelTopicBlocked(guid, channelId, topicId, 1);
|
||||||
},
|
},
|
||||||
clearTopicFlag: async (channelId, topicId) => {
|
clearTopicFlag: async (channelId, topicId) => {
|
||||||
const { guid } = access.current;
|
const { guid } = access.current;
|
||||||
await store.actions.setChannelTopicBlocked(guid, channelId, topicId, false);
|
await store.actions.setChannelTopicBlocked(guid, channelId, topicId, 0);
|
||||||
},
|
},
|
||||||
addChannelAlert: async (channelId) => {
|
addChannelAlert: async (channelId) => {
|
||||||
const { server, guid } = access.current;
|
const { server, guid } = access.current;
|
||||||
|
@ -315,7 +315,8 @@ export function useConversationContext() {
|
|||||||
else if (channelId) {
|
else if (channelId) {
|
||||||
channel.actions.setTopicFlag(channelId, topicId);
|
channel.actions.setTopicFlag(channelId, topicId);
|
||||||
}
|
}
|
||||||
setTopicField(topicId, 'blocked', true);
|
setTopicField(topicId, 'blocked', 1);
|
||||||
|
updateState({ topics: topics.current });
|
||||||
},
|
},
|
||||||
clearTopicFlag: async (topicId) => {
|
clearTopicFlag: async (topicId) => {
|
||||||
const { cardId, channelId } = conversationId.current || {};
|
const { cardId, channelId } = conversationId.current || {};
|
||||||
@ -325,7 +326,8 @@ export function useConversationContext() {
|
|||||||
else if (channelId) {
|
else if (channelId) {
|
||||||
channel.actions.clearTopicFlag(channelId, topicId);
|
channel.actions.clearTopicFlag(channelId, topicId);
|
||||||
}
|
}
|
||||||
setTopicField(topicId, 'blocked', false);
|
setTopicField(topicId, 'blocked', 0);
|
||||||
|
updateState({ topics: topics.current });
|
||||||
},
|
},
|
||||||
getTopicAssetUrl: (topicId, assetId) => {
|
getTopicAssetUrl: (topicId, assetId) => {
|
||||||
const { cardId, channelId } = conversationId.current || {};
|
const { cardId, channelId } = conversationId.current || {};
|
||||||
|
@ -129,6 +129,12 @@ export function useConversation() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
reportTopic: async (topicId) => {
|
||||||
|
await conversation.actions.addTopicAlert(topicId);
|
||||||
|
},
|
||||||
|
blockTopic: async (topicId) => {
|
||||||
|
await conversation.actions.setTopicFlag(topicId);
|
||||||
|
},
|
||||||
removeTopic: async (topicId) => {
|
removeTopic: async (topicId) => {
|
||||||
await conversation.actions.removeTopic(topicId);
|
await conversation.actions.removeTopic(topicId);
|
||||||
},
|
},
|
||||||
|
@ -107,7 +107,7 @@ export function useBlockedMessages() {
|
|||||||
unblock: async (cardId, channelId, topicId) => {
|
unblock: async (cardId, channelId, topicId) => {
|
||||||
const id = `${cardId}:${channelId}:${topicId}`;
|
const id = `${cardId}:${channelId}:${topicId}`;
|
||||||
if (cardId) {
|
if (cardId) {
|
||||||
card.actions.clearChannelTopicFlag(cardId, channelId, topicId);
|
card.actions.clearTopicFlag(cardId, channelId, topicId);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
channel.actions.clearTopicFlag(channelId, topicId);
|
channel.actions.clearTopicFlag(channelId, topicId);
|
||||||
|
Loading…
Reference in New Issue
Block a user