-angular.module("app").controller "PacketsController", ($scope, $location, $stateParams, $state, Blockchain, BlockchainAPI, Utils, $mdDialog) ->
+angular.module("app").controller "PacketsController", ($scope, $location, $stateParams, $state, Blockchain, BlockchainAPI, Utils, $mdDialog, Observer) ->
 
   $scope.frm_search =
     id: ""

      $scope.form_search_packet.id.error_message = Utils.formatAssertException(error.data.error.message)

  # get recent packets
  $scope.refresh_recent_packets = ->
    Blockchain.refresh_recent_packets().then (result) ->
      $scope.packets = result

  $scope.showPacket = (evt, id, pwd = null) ->
    # get packet cache from collection

        packet: (packet.password = pwd if pwd; packet)

    .then (succ) ->
      refresh_recent_packets()
    , () ->
      # cancelled, do nothing



  # init
  refresh_recent_packets()