Skip to content
This repository has been archived by the owner on Jun 13, 2023. It is now read-only.

Improve Mist alert #466

Merged
merged 4 commits into from
Mar 7, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions app/client/lib/helpers/templateHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,26 +28,26 @@ Check if in mist
@method (isMist)
**/
Template.registerHelper('isMist', function(){
return (typeof mist !== 'undefined');
return window.mistMode === 'mist';
});

/**
Check if in mist and in mist mode

@method (isMistMode)
@method (isWalletMode)
**/
Template.registerHelper('isWalletMode', function(){
return window.mistMode === 'wallet' || typeof mist === 'undefined'; // also show network info in normal browsers
});

/**
Check if currenct unit is an ether unit
Check if currency unit is an ether unit

@method (isEtherUnit)
**/
Template.registerHelper('isEtherUnit', function(){
var unit = EthTools.getUnit();
return !(unit === 'usd' || unit === 'eur' || unit === 'btc');
return !(unit === 'usd' || unit === 'eur' || unit === 'btc' || unit === 'gbp' || unit === 'brl');
});


Expand Down Expand Up @@ -85,7 +85,7 @@ Template.registerHelper('isVulnerable', function(address){
// add vulnerabilities to account
account.vulnerabilities = wallet.vulnerabilities;
return account;
} else
} else
return false;
});

Expand Down Expand Up @@ -114,7 +114,7 @@ Returns a list of accounts and wallets sorted by balance
**/
Template.registerHelper('selectAccounts', function(hideWallets){
var accounts = EthAccounts.find({balance:{$ne:"0"}}, {sort: {balance: 1}}).fetch();

if(hideWallets !== true)
accounts = _.union(Wallets.find({owners: {$in: _.pluck(EthAccounts.find().fetch(), 'address')}, address: {$exists: true}}, {sort: {name: 1}}).fetch(), accounts);

Expand Down Expand Up @@ -202,7 +202,7 @@ Formats a given transactions balance
Template.registerHelper('formatTransactionBalance', Helpers.formatTransactionBalance);


/**
/**
Formats address to a CaseChecksum

@method toChecksumAddress
Expand All @@ -215,12 +215,11 @@ Template.registerHelper('toChecksumAddress', function(address){



/**
/**
Takes a camelcase and shows it with spaces

@method toSentence
@param {string} camelCase A name in CamelCase or snake_case format
@return {string} sentence The same name with spaces
**/
Template.registerHelper('toSentence', Helpers.toSentence);

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<link rel="stylesheet" type="text/css" class="__meteor-css__" href="4f7bdea50360c3ca9b21c279125ad19fdad44d51.css?meteor_css_resource=true">
<script type="text/javascript">__meteor_runtime_config__ = JSON.parse(decodeURIComponent("%7B%22meteorRelease%22%3A%22METEOR%401.3.2.4%22%2C%22ROOT_URL_PATH_PREFIX%22%3A%22%22%2C%22meteorEnv%22%3A%7B%22NODE_ENV%22%3A%22production%22%7D%2C%22ROOT_URL%22%3A%22%22%7D"));</script>
<script type="text/javascript" src="05dc9d3227f604a73031fd4593c1156b091c493a.js"></script>
<script type="text/javascript" src="37af1f9b831e6c9025fee32f8568eaf7f34b05dd.js"></script>
<script type="text/javascript">Meteor.disconnect();</script>
<meta charset="utf-8">
<title>Ethereum Wallet</title>
Expand Down