Upload/Download progress; Mobile view
This commit is contained in:
parent
6b6bbdc142
commit
c1f24e3d41
35 changed files with 491 additions and 180 deletions
|
|
@ -46,6 +46,7 @@ const fetchMessage = async (id: string, communityId: string) => {
|
|||
const createMessage = async (
|
||||
communityId: string,
|
||||
channelId: string,
|
||||
ownerId: string,
|
||||
text: string,
|
||||
attachments: string[],
|
||||
replyToId?: string,
|
||||
|
|
@ -56,6 +57,24 @@ const createMessage = async (
|
|||
}
|
||||
const [encryptedMessage, iv] = encrypted;
|
||||
|
||||
const tempUUID = crypto.randomUUID();
|
||||
|
||||
setMessage({
|
||||
id: tempUUID,
|
||||
iv: iv,
|
||||
text: text,
|
||||
attachments: attachments,
|
||||
edited: false,
|
||||
reactions: [],
|
||||
creationDate: new Date().getTime(),
|
||||
editHistory: [],
|
||||
replyToId: replyToId,
|
||||
channelId: channelId,
|
||||
ownerId: ownerId,
|
||||
decryptionStatus: true,
|
||||
notSentYet: true,
|
||||
});
|
||||
|
||||
const data = await createMessageApi({
|
||||
text: encryptedMessage,
|
||||
iv: iv,
|
||||
|
|
@ -67,15 +86,14 @@ const createMessage = async (
|
|||
if (typeof data.error === "string") {
|
||||
return;
|
||||
}
|
||||
|
||||
deleteChannelMessage(channelId, tempUUID);
|
||||
|
||||
setMessage({
|
||||
...data,
|
||||
text: text,
|
||||
decryptionStatus: true,
|
||||
});
|
||||
|
||||
attachments.forEach((attachmentId) => {
|
||||
deleteAttachment(attachmentId);
|
||||
});
|
||||
};
|
||||
|
||||
const updateMessage = async (id: string, text: string, communityId: string) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue