@@ -1065,6 +1065,7 @@ angular.module('copayApp.controllers')
1065
1065
$scope . index . assetIndex = $scope . assetIndexSelectorValue ;
1066
1066
this . shownForm = 'payment' ;
1067
1067
}
1068
+ $scope . mtab = 1 ;
1068
1069
}
1069
1070
1070
1071
this . submitData = function ( ) {
@@ -1308,58 +1309,60 @@ angular.module('copayApp.controllers')
1308
1309
1309
1310
this . setForm = function ( to , amount , comment , asset , recipient_device_address ) {
1310
1311
this . resetError ( ) ;
1311
- delete this . binding ;
1312
- var form = $scope . sendPaymentForm ;
1313
- if ( ! form || ! form . address ) // disappeared?
1314
- return console . log ( 'form.address has disappeared' ) ;
1315
- if ( to ) {
1316
- form . address . $setViewValue ( to ) ;
1317
- form . address . $isValid = true ;
1318
- form . address . $render ( ) ;
1319
- this . lockAddress = true ;
1320
- if ( recipient_device_address ) // must be already paired
1321
- assocDeviceAddressesByPaymentAddress [ to ] = recipient_device_address ;
1322
- }
1312
+ $timeout ( ( function ( ) {
1313
+ delete this . binding ;
1314
+ var form = $scope . sendPaymentForm ;
1315
+ if ( ! form || ! form . address ) // disappeared?
1316
+ return console . log ( 'form.address has disappeared' ) ;
1317
+ if ( to ) {
1318
+ form . address . $setViewValue ( to ) ;
1319
+ form . address . $isValid = true ;
1320
+ form . address . $render ( ) ;
1321
+ this . lockAddress = true ;
1322
+ if ( recipient_device_address ) // must be already paired
1323
+ assocDeviceAddressesByPaymentAddress [ to ] = recipient_device_address ;
1324
+ }
1323
1325
1324
- if ( amount ) {
1325
- // form.amount.$setViewValue("" + amount);
1326
- // form.amount.$isValid = true;
1327
- this . lockAmount = true ;
1328
- $timeout ( function ( ) {
1329
- form . amount . $setViewValue ( "" + profileService . getAmountInDisplayUnits ( amount , asset ) ) ;
1330
- form . amount . $isValid = true ;
1326
+ if ( amount ) {
1327
+ // form.amount.$setViewValue("" + amount);
1328
+ // form.amount.$isValid = true;
1329
+ this . lockAmount = true ;
1330
+ $timeout ( function ( ) {
1331
+ form . amount . $setViewValue ( "" + profileService . getAmountInDisplayUnits ( amount , asset ) ) ;
1332
+ form . amount . $isValid = true ;
1333
+ form . amount . $render ( ) ;
1334
+ } ) ;
1335
+ }
1336
+ else {
1337
+ this . lockAmount = false ;
1338
+ form . amount . $pristine = true ;
1339
+ form . amount . $setViewValue ( '' ) ;
1331
1340
form . amount . $render ( ) ;
1332
- } ) ;
1333
- }
1334
- else {
1335
- this . lockAmount = false ;
1336
- form . amount . $pristine = true ;
1337
- form . amount . $setViewValue ( '' ) ;
1338
- form . amount . $render ( ) ;
1339
- }
1340
- // form.amount.$render();
1341
+ }
1342
+ // form.amount.$render();
1341
1343
1342
- if ( form . merkle_proof ) {
1343
- form . merkle_proof . $setViewValue ( '' ) ;
1344
- form . merkle_proof . $render ( ) ;
1345
- }
1346
- if ( comment ) {
1347
- form . comment . $setViewValue ( comment ) ;
1348
- form . comment . $isValid = true ;
1349
- form . comment . $render ( ) ;
1350
- }
1344
+ if ( form . merkle_proof ) {
1345
+ form . merkle_proof . $setViewValue ( '' ) ;
1346
+ form . merkle_proof . $render ( ) ;
1347
+ }
1348
+ if ( comment ) {
1349
+ form . comment . $setViewValue ( comment ) ;
1350
+ form . comment . $isValid = true ;
1351
+ form . comment . $render ( ) ;
1352
+ }
1351
1353
1352
- if ( asset ) {
1353
- var assetIndex = lodash . findIndex ( $scope . index . arrBalances , {
1354
- asset : asset
1355
- } ) ;
1356
- if ( assetIndex < 0 )
1357
- throw Error ( "failed to find asset index of asset " + asset ) ;
1358
- $scope . index . assetIndex = assetIndex ;
1359
- this . lockAsset = true ;
1360
- }
1361
- else
1362
- this . lockAsset = false ;
1354
+ if ( asset ) {
1355
+ var assetIndex = lodash . findIndex ( $scope . index . arrBalances , {
1356
+ asset : asset
1357
+ } ) ;
1358
+ if ( assetIndex < 0 )
1359
+ throw Error ( "failed to find asset index of asset " + asset ) ;
1360
+ $scope . index . assetIndex = assetIndex ;
1361
+ this . lockAsset = true ;
1362
+ }
1363
+ else
1364
+ this . lockAsset = false ;
1365
+ } ) . bind ( this ) , 1 ) ;
1363
1366
} ;
1364
1367
1365
1368
this . resetForm = function ( ) {
0 commit comments