Hi,
I am using firebase on backend. All chat messages saved on firebase as 'messages'. If a message deleted from firebase, the giftedchat sould be refresh messages and the deleted message shouldn't be on giftedchat view anymore. Is it possible to do that ?
Do you really delete the message from the firebase array? I suggest to add a property isDeleted and make it true if you want to delete the message. In the component itself just check for that property and render null if it is true. renderMessage() can be used for that
@yernandus I did that, and here is the my renderMessage ;
renderMessage (props) {
if(!props.currentMessage.isDeleted) {
return (
<Message
{...props}
/>
)
}
else return null;
}
But if message on firebase marked as isDeleted=true then the chat view NOT update itself automatically.
Do you know about this ?
you check it from props.currentMessage
On Tue, Nov 28, 2017 at 4:42 PM, ozankonur notifications@github.com wrote:
@yernandus https://github.com/yernandus how can I check that isDeleted
property on renderMessage function ?
renderMessage (props) {
return (
{...props}
{...messageStyles}
/>
)
}—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/FaridSafi/react-native-gifted-chat/issues/650#issuecomment-347483642,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AD4QVrJ4NYo7KBxBIhhowuWKxwwNw6vgks5s6-OmgaJpZM4Qsxb1
.
--
С уважением,
Ернар Амергалиев
@yernandus I am already checking it and it is working. My problem is about update screen. React Native is not updating screen automatically
do you use redux?
On Wed, Nov 29, 2017 at 11:29 AM, ozankonur notifications@github.com
wrote:
@yernandus https://github.com/yernandus I am already checking it and it
is working. My problem is about update screen. React Native is not updating
screen automatically—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/FaridSafi/react-native-gifted-chat/issues/650#issuecomment-347757212,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AD4QVtaUzZffT0n-7hrd7hS-fDZqPOyjks5s7OupgaJpZM4Qsxb1
.
--
С уважением,
Ернар Амергалиев
yes
make sure you update the store the right way, you should always return a
new object, new reference
On Wed, Nov 29, 2017 at 11:33 AM, ozankonur notifications@github.com
wrote:
yes
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/FaridSafi/react-native-gifted-chat/issues/650#issuecomment-347757858,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AD4QVnOk1HucJS3iofIBwzd4mMXuN_Gcks5s7Oy-gaJpZM4Qsxb1
.
--
С уважением,
Ернар Амергалиев
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Most helpful comment
make sure you update the store the right way, you should always return a
new object, new reference
On Wed, Nov 29, 2017 at 11:33 AM, ozankonur notifications@github.com
wrote:
--
С уважением,
Ернар Амергалиев