             MessageActionCreator.delete {messageID}
             LayoutActionCreator.hideModal() if isModal
 
-            # Goto next message
-            Utils.messageSetCurrent next
+            if next?.size
+                # Goto next message
+                Utils.messageSetCurrent next
+            else
+                # Close 2nd panel
+                Utils.messageClose()
 
         settings = SettingsStore.get()
 

        href = window.location.href
        href = href.replace /\/message\/[\w-]+/gi, ''
        href = href.replace /\/conversation\/[\w-]+\/[\w-]+/gi, ''
        window.location.href = href


    messageDeleteCurrent: ->
        messageID = MessageStore.getCurrentID()

            direction: 'second'
            action: action
            parameters: params

        url = window.router.buildUrl urlOptions
        window.router.navigate url, {trigger: true}

