-
-
Notifications
You must be signed in to change notification settings - Fork 509
Description
I don't find any proper way to display messages that are sending to server at the moment (saved ones). The problem is that I don't know message ID until server response.
What I'm doing: I assign temporary ID to new message like -Math.floor(1000 * Math.random()), and I always know that messages with negative IDs are sending ones. Then I add this message to messages array so user can see all messages he wrote right after he send it (in my case server may respond in 5 seconds, that's pretty much).
My problem is that after server responds and provides real message ID, I mark the message as distributed and try to change ID, but changing message ID cause wrong animation as if some new message was sent then immediately disappeared. Is there a way to change message ID without animation? Or maybe I'm just doing something wrong, is there another way to show saved messages without ID and then mark them as distributed?
