 
   updateMessage: ->
 
+    return @deletePostButtonHandler()  if @state.isDeleting
+
     name  = @props.channelName
     value = @state.editInputValue
     messageId = @props.message.get '_id'

ImmutableRenderMixin  = require 'react-immutable-render-mixin'
MessageLink           = require 'activity/components/publicchannelmessagelink'
EmbedBox              = require 'activity/components/embedbox'

module.exports = class ChatListItem extends React.Component



  onEditInputKeyDown: (event) ->

    { ESC, ENTER, BACKSPACE } = KeyboardKeys

    switch event.which
      when ESC         then @cancelEdit()
      when ENTER       then @updateMessage()
      when BACKSPACE   then @onEditInputBackspace event


  onEditInputBackspace: (event) ->

    return yes  if @state.editInputValue
    kd.utils.stopDOMEvent event
    @setState isDeleting: yes


  getEditModeClassNames: -> classnames
