-
Notifications
You must be signed in to change notification settings - Fork 277
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FEAT: Added draft-saving feature for messages, which automatically sends them when the internet is restored. #722
base: develop
Are you sure you want to change the base?
Conversation
…red and some validations
Woah, this looks like a huge PR, i'll need some time to review this |
No problem! Take your time, and let me know if you need anything. Welcome! :) |
Hi @dhairyashiil |
Hello @Spiral-Memory, I have removed the toast message logic as you suggested. Currently, if the user is offline, they can still see their messages on the screen due to the upsert message functionality. Also, WhatsApp shows messages with a circle tick in the bottom-right corner. Do you think I should implement that too? |
Yes |
if (navigator.onLine && messageQueue.length > 0) { | ||
for (let i = 0; i < messageQueue.length; i += 1) { | ||
const pendingMessage = JSON.parse(messageQueue[i]); | ||
const res = await RCInstance.sendMessage( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Spiral-Memory
I'm getting a lint error for using await inside a loop, and we need this logic to send offline messages in order. Is there a way to resolve this error?
Okay, I will work on it |
Brief Title
Added draft-saving feature for messages, which automatically sends them when the internet is restored.
Acceptance Criteria fulfillment
Also added the following:
Fixes #721
Video/Screenshots
In the above video, I have not shown a demo for the video messages but that too works as expected.
Upsert message functionality for file messages (consistent UI).
(To see the upsert message functionality for audio messages, refer to the demo video above.)
6.upserting.message.mp4
Validation for File Messages.
4.file.message.mp4
Validation for Edit Messages.
5.edit.message.mp4
PR Test Details
Note: The PR will be ready for live testing at https://rocketchat.github.io/EmbeddedChat/pulls/pr-722 after approval. Contributors are requested to replace
<pr_number>
with the actual PR number.