                 if err
                     console.log("Error getting user namees -- ", err)
                 else
-
-                    # Send each message to the correct handler
+                    # Clear the chat output
+                    chat_output.empty()
+
+                    # Use handler to render each message
                     last_mesg = undefined
                     for mesg in all_messages
 

###



CLICK_TO_EDIT = "Edit text..."

# seconds to wait for synchronized doc editing session, before reporting an error.

            # done -- no need to render anything.
            return

        # The chat message area
        chat_output = @element.find(".salvus-editor-codemirror-chat-output")

        messages = messages.split('\n')

