PhantomAppDevelopment / pizza-app

An Adobe AIR mobile app that uses the Yelp Fusion & Firebase V3 API to create a small social network for pizza lovers.
https://play.google.com/store/apps/details?id=air.im.phantom.pizza
MIT License
15 stars 2 forks source link

send message twice #4

Closed benkhachouch closed 7 years ago

benkhachouch commented 7 years ago

in ChatroomScreen

if (messageInput.text != "") { event.currentTarget.removeEventListener(starling.events.Event.TRIGGERED, sendMessage); ..

agentphantom commented 7 years ago

To fix this I applied a more practical alternative that does the same as removing and adding the event listener.

I declared the sendButton as a private var at the top and set isEnabled to false when the message is sending, and back to true when it has been sent or failed.