mirror of
https://github.com/balzack/databag.git
synced 2025-02-12 03:29:16 +00:00
more webapp conversation refactor
This commit is contained in:
parent
3ceea69f99
commit
d0ee4a7515
@ -284,7 +284,8 @@ export function useCardContext() {
|
||||
let node = cardProfile.node;
|
||||
if (files?.length) {
|
||||
const topicId = await addContactChannelTopic(node, token, channelId, null, null, null);
|
||||
upload.actions.addContactTopic(node, token, cardId, channelId, topicId, files, async (assets) => {
|
||||
const contact = { server: node, cardId };
|
||||
upload.actions.addTopic(token, channelId, topicId, files, async (assets) => {
|
||||
const subject = message(assets);
|
||||
await setContactChannelTopicSubject(node, token, channelId, topicId, type, subject);
|
||||
}, async () => {
|
||||
@ -294,7 +295,7 @@ export function useCardContext() {
|
||||
catch(err) {
|
||||
console.log(err);
|
||||
}
|
||||
});
|
||||
}, contact);
|
||||
}
|
||||
else {
|
||||
const subject = message([]);
|
||||
|
@ -59,12 +59,13 @@ export function useUploadContext() {
|
||||
const actions = {
|
||||
addTopic: (token, channelId, topicId, files, success, failure, contact) => {
|
||||
if (contact) {
|
||||
const { server, token, cardId } = contact;
|
||||
const { server, cardId } = contact;
|
||||
|
||||
let host = "";
|
||||
if (server) {
|
||||
host = `https://${server}`
|
||||
}
|
||||
|
||||
const controller = new AbortController();
|
||||
const entry = {
|
||||
index: index.current,
|
||||
|
@ -35,6 +35,7 @@ export function AddTopic({ contentKey }) {
|
||||
modal.error({
|
||||
title: 'Failed to Post Message',
|
||||
content: 'Please try again.',
|
||||
bodyStyle: { padding: 16 },
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -181,11 +181,11 @@ export function Details({ cardId, channelId, closeDetails, closeConversation, op
|
||||
</div>
|
||||
</div>
|
||||
<Modal title="Edit Subject" centered visible={state.editSubject} footer={editSubjectFooter}
|
||||
onCancel={actions.clearEditSubject}>
|
||||
bodyStyle={{ padding: 16 }} onCancel={actions.clearEditSubject}>
|
||||
<EditSubject state={state} actions={actions} />
|
||||
</Modal>
|
||||
<Modal title="Edit Members" centered visible={state.editMembers} footer={editMembersFooter}
|
||||
onCancel={actions.clearEditMembers}>
|
||||
bodyStyle={{ padding: 16 }} onCancel={actions.clearEditMembers}>
|
||||
<EditMembers state={state} actions={actions} />
|
||||
</Modal>
|
||||
</DetailsWrapper>
|
||||
|
Loading…
Reference in New Issue
Block a user