Commit eaa1b9c0 authored by Benoit Lavenier's avatar Benoit Lavenier

[fix] Wallet list : balance is always in relative unit - fix #725

parent 6eb46c92
......@@ -157,6 +157,7 @@
<script src="dist/dist_js/app/controllers/login-controllers.js"></script>
<script src="dist/dist_js/app/controllers/help-controllers.js"></script>
<script src="dist/dist_js/app/controllers/wallet-controllers.js"></script>
<script src="dist/dist_js/app/controllers/wallets-controllers.js"></script>
<script src="dist/dist_js/app/controllers/wot-controllers.js"></script>
<script src="dist/dist_js/app/controllers/network-controllers.js"></script>
<script src="dist/dist_js/app/controllers/currency-controllers.js"></script>
......
......@@ -5,6 +5,7 @@ angular.module('cesium.controllers', [
'cesium.login.controllers',
'cesium.help.controllers',
'cesium.wallet.controllers',
'cesium.wallets.controllers',
'cesium.currency.controllers',
'cesium.wot.controllers',
'cesium.transfer.controllers',
......
......@@ -164,7 +164,7 @@ function TransferModalController($scope, $q, $translate, $timeout, $filter, $foc
wallet = $scope.enableSelectWallet && ($scope.formData.walletId ? csWallet.children.get($scope.formData.walletId) : csWallet) || csWallet;
if (!wallet.isDefault()) {
console.debug("[transfer] Using {" + wallet.id + "} wallet");
console.debug("[transfer] Using wallet {" + wallet.id + "}");
}
// Make to sure to load full wallet data (balance)
return wallet.login({sources: true, silent: true})
......@@ -413,7 +413,7 @@ function TransferModalController($scope, $q, $translate, $timeout, $filter, $foc
if (!newWallet || (wallet && wallet.id === newWallet.id)) return;
wallet = newWallet;
$scope.walletData = wallet.data;
console.debug("[transfer] Using {" + wallet.id + "} wallet");
console.debug("[transfer] Using wallet {" + wallet.id + "}");
$scope.onAmountChanged();
});
};
......
This diff is collapsed.
This diff is collapsed.
......@@ -72,11 +72,9 @@ function ESViewEditProfileController($scope, $q, $timeout, $state, $focus, $tran
return $scope.showHome();
}
$scope.loadWallet({
wallet: wallet,
auth: true,
minData: true
})
return wallet.auth({
minData: true
})
.then($scope.load)
.catch(function(err){
if (err == 'CANCELLED') {
......@@ -152,34 +150,32 @@ function ESViewEditProfileController($scope, $q, $timeout, $state, $focus, $tran
$scope.updateView(walletData, {});
}
UIUtils.loading.hide();
// Update loading - done with a delay, to avoid trigger onFormDataChanged()
return $timeout(function() {
$scope.loading = false;
}, 1000);
})
.then(function() {
// removeIf(device)
$focus('profile-name');
// endRemoveIf(device)
})
.catch(function(err){
UIUtils.loading.hide(10);
UIUtils.onError('PROFILE.ERROR.LOAD_PROFILE_FAILED')(err);
});
.catch(UIUtils.onError('PROFILE.ERROR.LOAD_PROFILE_FAILED'));
};
$scope.setForm = function(form) {
$scope.form = form;
};
$scope.updateView = function(wallet, profile) {
$scope.walletData = wallet;
$scope.updateView = function(walletData, profile) {
$scope.walletData = walletData;
$scope.formData = profile;
if (profile.avatar) {
$scope.avatarStyle={'background-image':'url("'+$scope.avatar.src+'")'};
}
$scope.motion.show();
UIUtils.loading.hide();
// Update loading - done with a delay, to avoid trigger onFormDataChanged()
$timeout(function() {
$scope.loading = false;
}, 1000);
};
$scope.onFormDataChanged = function() {
......
......@@ -1026,7 +1026,6 @@ function ESRegistryRecordEditController($scope, $timeout, $state, $q, $ionicHis
if ($scope.loading) {
wallet = (state.stateParams && state.stateParams.wallet && state.stateParams.wallet != 'default') ? csWallet.children.get(state.stateParams.wallet) : csWallet;
console.log(wallet);
if (!wallet) {
UIUtils.alert.error('ERROR.UNKNOWN_WALLET_ID');
return $scope.showHome();
......
......@@ -217,7 +217,6 @@ angular.module('cesium.es.settings.services', ['cesium.services', 'cesium.es.htt
var isEnable = that.isEnable();
if (isEnable && csWallet.isAuth()) {
console.log(data);
if (!wasEnable) {
onWalletAuth(csWallet.data);
}
......
......@@ -379,8 +379,6 @@ function MapWotViewController($scope, $filter, $templateCache, $interpolate, $ti
return $timeout(function(){
$scope.loading = false;
console.log("dataload");
// hide loading indicator
map.fire('dataload');
......
......@@ -5,7 +5,7 @@
<i ng-if="::!walletData.avatar" class="item-image icon"
ng-class=":rebind:{'ion-card': !walletData.isMember, 'ion-persion': walletData.isMember}"></i>
<i ng-if="::walletData.avatar" class="item-image avatar" style="background-image: url({{::walletData.avatar.src}})"></i>
<!--<i ng-hide=":rebind:wallet.isAuth()" class="icon-secondary assertive ion-locked" style="top: -16px; left: 66px; font-size: 20px;"></i>-->
<i ng-hide=":rebind:wallet.isAuth()" class="icon-secondary assertive ion-locked" style="top: -16px; left: 66px; font-size: 20px;"></i>
<h2>
<span class="text-editable" ng-click="editWallet($event, wallet)" title="{{'ACCOUNT.WALLET_LIST.BTN_RENAME'|translate}}">
<ng-if ng-if=":rebind:walletData.localName||walletData.name||walletData.uid" ng-bind-html="::walletData.localName||walletData.name||walletData.uid"></ng-if>
......@@ -39,7 +39,7 @@
<span class="badge" ng-if="formData.showBalance"
ng-class=":rebind:{'badge-assertive': (walletData.balance <= 0), 'badge-balanced': (walletData.balance > 0) }">
<span ng-bind-html=":rebind:walletData.balance|formatAmount:{useRelative: true, currency: currency}"></span>
<span ng-bind-html=":rebind:walletData.balance|formatAmount:{useRelative: formData.useRelative, currency: currency}"></span>
</span>
<i class="icon ion-ios-arrow-right "></i>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment