Skip to content
Snippets Groups Projects
Select Git revision
  • c429f0358b959f8ba9515d24cadac46fce4d77e0
  • master default protected
  • chrome-manifest-v3
  • feature/migrate-cordova-13
  • feat/improve-network-scan
  • feat/force-migration-check
  • develop
  • feature/encrypted_comment
  • feature/android_api_19
  • gitlab_migration_1
  • rml8
  • v1.7.15-rc1
  • v1.7.14
  • v1.7.13
  • v1.7.12
  • v1.7.11
  • v1.7.10
  • v1.7.9
  • v1.7.8
  • v1.7.7
  • v1.7.6
  • v1.7.5
  • v1.7.4
  • v1.7.3
  • v1.7.2
  • v1.7.1
  • v1.7.0
  • v1.7.0-rc2
  • v1.7.0-rc1
  • v1.6.12
  • v1.6.11
31 results

wallet-controllers.js

Blame
  • wallet-controllers.js 10.61 KiB
    
    angular.module('cesium.wallet.controllers', ['cesium.services', 'cesium.currency.controllers'])
    
      .config(function($stateProvider, $urlRouterProvider) {
        'ngInject';
        $stateProvider
    
          .state('app.view_wallet', {
            url: "/wallet",
            views: {
              'menuContent': {
                templateUrl: "templates/wallet/view_wallet.html",
                controller: 'WalletCtrl'
              }
            }
          })
    
          .state('app.view_wallet_tx_errors', {
            url: "/wallet/tx/errors",
            views: {
              'menuContent': {
                templateUrl: "templates/wallet/view_wallet_tx_error.html",
                controller: 'WalletTxErrorCtrl'
              }
            }
          })
        ;
      })
    
      .controller('WalletCtrl', WalletController)
    
      .controller('WalletTxErrorCtrl', WalletTxErrorController)
    ;
    
    function WalletController($scope, $rootScope, $state, $q, $ionicPopup, $ionicActionSheet, $timeout,
      UIUtils, Wallet, BMA, $translate, Device, $ionicPopover) {
      'ngInject';
    
      $scope.walletData = null;
      $scope.convertedBalance = null;
      $scope.hasCredit = false;
      $scope.showDetails = false;
    
      $scope.$on('$ionicView.enter', function(e, $state) {
        $scope.loadWallet()
          .then(function(wallet) {
            $scope.updateView(wallet);
            $scope.showFab('fab-transfer');
            $scope.showQRCode('qrcode', wallet.pubkey, 1100);
            UIUtils.loading.hide();
          });
    
          $timeout(function () {
            var header = document.getElementById('wallet-header');
            header.classList.toggle('on', true);
          }, 100);
      });
    
      $ionicPopover.fromTemplateUrl('templates/wallet/popover_actions.html', {
        scope: $scope
      }).then(function(popover) {
        $scope.actionsPopover = popover;
      });
    
      //Cleanup the popover when we're done with it!
      $scope.$on('$destroy', function() {
        $scope.actionsPopover.remove();
      });
    
      $scope.refreshConvertedBalance = function() {