Repository navigation
Commit 97bdea0
authored
Keep the typed text when sending a sticker or GIF from the panel (#151)
* Keep the typed text when sending a sticker or GIF from the panel
sendAppFile finishes with _afterSentTransition(false) so the input is
kept, but _afterSentTransition reset the input state unconditionally
right after the flushInput check, so every sticker or GIF sent from the
panel erased the draft.
Remove the unconditional reset. Every other send path passes true and
still clears the field, and sticker suggestions clear the input
themselves. iOS keeps the typed text in the same case.
* Keep the link preview and effect with the text kept after a sticker
When a sticker or GIF is sent without flushing the input, keep the
dismissed link preview, the current preview and the chosen message
effect that belong to the kept text, and reset them only when the
input is flushed.
* Reset the compose state with the text when the input ends up empty
Sticker suggestions and the media preview clear the input themselves
before the send completes, so keeping the link preview and the effect
whenever the input was not flushed left them applied to the next
message. Keep them, and the suggested post too, only when the input
still has text after the send.
* Keep suggestions with the kept text and reset while editing
When the input text is kept after a sticker or GIF, keep the mention,
command or sticker suggestion list for it too. While a message is being
edited, reset the compose state as before, since the kept-text check
would otherwise look at the hidden draft instead of the edit.
* Run the pending after-send handler before a sticker send sets its own
A sticker or GIF sent from the panel before the history update of a just-sent
text message replaced that message's handler, so the sent text stayed in the
field. The pending handler now runs first and clears it.
* Reset the effect with a sticker send and keep its reply
The message effect and suggested post were kept with the text after a
sticker or GIF send; they are now reset, as on iOS. The pending
after-send step of an earlier send runs before the forwards are checked,
so a stale forward flag no longer sends an empty composer, while the
sticker still takes the reply. A scheduled sticker runs its step right
away, as sendMessage does.1 parent 6be9999 commit 97bdea0
1 file changed
Lines changed: 18 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4518 | 4518 | | |
4519 | 4519 | | |
4520 | 4520 | | |
4521 | | - | |
4522 | | - | |
| 4521 | + | |
| 4522 | + | |
| 4523 | + | |
4523 | 4524 | | |
4524 | 4525 | | |
4525 | 4526 | | |
4526 | | - | |
| 4527 | + | |
4527 | 4528 | | |
4528 | 4529 | | |
| 4530 | + | |
4529 | 4531 | | |
4530 | 4532 | | |
4531 | | - | |
4532 | 4533 | | |
4533 | | - | |
4534 | 4534 | | |
4535 | 4535 | | |
4536 | 4536 | | |
| |||
4541 | 4541 | | |
4542 | 4542 | | |
4543 | 4543 | | |
4544 | | - | |
| 4544 | + | |
4545 | 4545 | | |
4546 | 4546 | | |
4547 | 4547 | | |
| |||
6761 | 6761 | | |
6762 | 6762 | | |
6763 | 6763 | | |
6764 | | - | |
6765 | 6764 | | |
| 6765 | + | |
| 6766 | + | |
| 6767 | + | |
6766 | 6768 | | |
6767 | 6769 | | |
6768 | 6770 | | |
6769 | 6771 | | |
6770 | | - | |
| 6772 | + | |
6771 | 6773 | | |
6772 | | - | |
| 6774 | + | |
6773 | 6775 | | |
6774 | 6776 | | |
6775 | | - | |
| 6777 | + | |
6776 | 6778 | | |
6777 | 6779 | | |
6778 | 6780 | | |
6779 | 6781 | | |
6780 | 6782 | | |
6781 | 6783 | | |
6782 | 6784 | | |
6783 | | - | |
| 6785 | + | |
| 6786 | + | |
| 6787 | + | |
| 6788 | + | |
| 6789 | + | |
| 6790 | + | |
6784 | 6791 | | |
6785 | 6792 | | |
6786 | 6793 | | |
| |||
0 commit comments