 
 getCondCountdown = (deck) ->
   {$ships, $slotitems, _ships} = window
-  countdown = 0
-  cond = 49
-  for shipId in deck.api_ship
-    continue if shipId == -1
+  countdown = [0, 0, 0, 0, 0, 0]
+  cond = [49, 49, 49, 49, 49, 49]
+  for shipId, i in deck.api_ship
+    if shipId == -1
+      countdown[i] = 0
+      cond[i] = 49
+      continue
     ship = _ships[shipId]
-    if ship.api_cond < 49
-      cond = Math.min(cond, ship.api_cond)
-    countdown = Math.max(countdown, Math.ceil((49 - cond) / 3) * 180)
+    # if ship.api_cond < 49
+    #   cond[i] = Math.min(cond[i], ship.api_cond)
+    cond[i] = ship.api_cond
+    countdown[i] = Math.max(countdown[i], Math.ceil((49 - cond[i]) / 3) * 180)
   ret =
     countdown: countdown
     cond: cond

    decks = window._decks
    @messages = getDeckMessage decks[@props.deckIndex]
    tmp = getCondCountdown decks[@props.deckIndex]
    @countdown = tmp.countdown
    if tmp.cond isnt @cond
      @timeDelta = 0
      @cond = tmp.cond
    if @countdown > 0
      @interval = setInterval @updateCountdown, 1000 if !@interval?
    else
      @interval = clearInterval @interval if @interval?
  componentWillUpdate: ->
    @setAlert()
  updateCountdown: ->
    flag = true
    if @countdown - @timeDelta > 0
      flag = false
      @timeDelta += 1
      # Use DOM operation instead of React for performance
      if @isMount
        $("#ShipView #deck-condition-countdown-#{@props.deckIndex}-#{@componentId}").innerHTML = resolveTime(@countdown - @timeDelta)
      if @countdown is @timeDelta and not @inBattle and window._decks[@props.deckIndex].api_mission[0] <= 0
        notify "#{@props.deckName} 疲劳回复完成", {icon: join(ROOT, 'assets', 'img', 'operation', 'sortie.png')}
    @interval = clearInterval @interval if flag
  componentWillMount: ->
    @componentId = Math.ceil(Date.now() * Math.random())
    @setAlert()


TopAlert = React.createClass
  messages: ['没有舰队信息']
  countdown: [0, 0, 0, 0, 0, 0]
  maxCountdown: 0
  timeDelta: 0
  cond: [0, 0, 0, 0, 0, 0]
  isMount: false
  inBattle: false
  handleResponse: (e) ->
