-
Notifications
You must be signed in to change notification settings - Fork 238
Added lastMessage function to examples #16
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
Conversation
(Tested, it works :D)
.set() overrode old room fields which broke everything. I fixed this issue in this commit.
|
It looks cool, but the Room model has no a |
|
It will have soon, and it will be an array |
This creates it if it doesn't exist already |
i was talking about the |
Check out the issue I made, it contains some nice code that gets latest message without using the dart model. I'm using this in the meantime until it gets added to the package. |
|
Is it ready to be merged? |
|
Hi, I think we may need to change the onWrite to onUpdate This will ensure that rooms document will only get updated just once. At the moment it updates twice, since the other cloud function (changeMessageStatus) will trigger another onWrite So I simply changed from onWrite to onUpdate |
|
Hi @markzakharyan sorry was on vacation, but now I'm back. If you can please test @mashegoindustries suggestion and update the PR if needed that would be great! I have also updated Dart model (it now has |
I just tested it, it works well. But maybe it would be better to have just one function maybe |
|
I guess that's fine if everything still works :) |
|
@markzakharyan Could you also add a example function for the |
I'm sorry @SalahAdDin what feature are you referring to? |
@markzakharyan This one: https://github.com/flyerhq/flutter_firebase_chat_core/blob/main/lib/src/firebase_chat_core.dart#L179 |
|
Can I merge this? Can't find an update to a single function. Request above is not related to this PR. |
Go ahead. I think it's better documentation if there's two functions. But in my particular usecase I'll just have one function. |
|
Thanks for the PR! |
|
Updated |
(Tested, it works :D)
Changed old cloud functions example to js and a newer (not deprecated environment). Also added cloud functions example for changing a room's
lastMessage