<% if @message.persisted? %>
  var data = {
    success : true,
    statusMessage : '<%=j @notification[:notice].html_safe %>',
    sentMessage : '<%=j render "shared/message_list", message: @message.claim %>'
  }
  adp.messaging.processMsg(data);

  <% unless Claim::VALID_STATES_FOR_REDETERMINATION.include?(@message.claim.state) %>
    $('.claim-action-dropdown').hide();
  <% end %>

  <% unless @message.claim.written_reasons_outstanding? %>
    $('.written-reasons-checkbox').hide();
  <% end %>
<% else %>
  var data ={
    success : false,
    statusMessage : '<%=j @notification[:alert].html_safe %>'
  }
  adp.messaging.processMsg(data);
<% end %>

<% if @message.persisted? %>
  var data = {
    success : true,
    statusMessage : '<%=j @notification[:notice].html_safe %>',
    sentMessage : '<%=j render "shared/message_list", message: @message.claim %>'
  }
  adp.messaging.processMsg(data);

  <% unless Claim::VALID_STATES_FOR_REDETERMINATION.include?(@message.claim.state) %>
    $('.js-hide-status').hide();
  <% end %>

  <% unless @message.claim.written_reasons_outstanding? %>
    $('.written-reasons-checkbox').hide();
  <% end %>
<% else %>
  var data ={
    success : false,
    statusMessage : '<%=j @notification[:alert].html_safe %>'
  }
  adp.messaging.processMsg(data);
<% end %>

Hide the status update section if they have send it as part of the message
Hide the status update section if they have send it as part of the message
