-
Notifications
You must be signed in to change notification settings - Fork 987
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Generating message preview on the fly (#645, #754) #757
Conversation
resources/commands.js
Outdated
handler: function (params) { | ||
return { | ||
event: "request", | ||
params: [params.amount], | ||
request: { | ||
command: "send", | ||
contentCommand: "request", |
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.
Instead of specifying this information here we could get it from parameters here https://github.com/status-im/status-react/blob/8663bdfada6f1d7690a6fb0ab1a88236eaef0e34/src/status_im/chat/handlers/send_message.cljs#L286-L286
Command's name can be found in the same map as chat-id
and command
, the path is [:command-name :command :name]
.
It would be great to start using specs there, but that's not objective of this PR.
223c046
to
6134bfd
Compare
@rasom done, no more |
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.
@rasom I've updated the code. Please, check it now. |
yes it's supposed to be regionalised.... didn't we have an issue for this? |
That's what #754 is about, thanks. |
@rasom how can I reproduce this bug? |
I was using two devices: the first Android with English and the second iOS with the Russian language. Then I just sent some ETH between them. |
Phew, it was hard :(
The final solution works, but it is a bit hacky — I use |
@alwx, does this issue #779 mean that this will be fixed in another PR? |
@rasom it means that the code for generating preview messages in chat list will be rewritten and moved to JS. So I decided not to pay too much attention to this problem here because it will be reimplemented anyway. |
In order to fix #645 we needed to change the way we do rendering, because it is almost impossible to translate the content that was pre-rendered before and saved to database.
This PR introduces the new way of rendering — I've removed
:preview
and:rendered-preview
from the message model and made the process dynamic. And since the rendering became dynamic, we can easily translate almost everything every time we need.Fixes #645, #754