   packet.poi_timestamp = timestamp
   packet.poi_comment = comment
 
+savePacket = (packet) ->
+  setTimeout (->
+    return unless packet? and packet.poi_timestamp?
+    filename = packet.poi_timestamp
+    file = path.join(APPDATA, "#{filename}.json")
+    data = JSON.stringify(packet)
+    fs.writeFile file, data, (error) ->
+      return unless error
+      console.error error
+  ), 0
+
 
 MainArea = React.createClass
   componentDidMount: ->


# constant
MAX_PACKET_NUMBER = 128

$('#font-awesome')?.setAttribute 'href', "#{ROOT}/components/font-awesome/css/font-awesome.min.css"

updateNonce = (nonce) ->
  if typeof nonce == "number" and nonce > 0

    battlePacket: null

  handleResponse: (e) ->
    `var path;`   # HACK: Force shadowing an variable `path`;
    {method, path, body, postBody} = e.detail
    {isCombined, isCarrier, battleComment, battlePackets, battlePacketsNonce, battleNonce, battlePacket} = @state
    isStateChanged = false
