Skip to content

Commit

Permalink
Merge pull request #157 from blocknetdx/dev
Browse files Browse the repository at this point in the history
1.0.4
  • Loading branch information
rBurgett authored Sep 20, 2021
2 parents e6db49a + 85b0b8e commit 60d501c
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 7 deletions.
6 changes: 3 additions & 3 deletions bin.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"linux": "https://s3.us-east-1.amazonaws.com/cloudchainsinc.com/downloads/cc-release-0.5.11-linux.zip",
"mac": "https://s3.us-east-1.amazonaws.com/cloudchainsinc.com/downloads/cc-release-0.5.11-osx.zip",
"win": "https://s3.us-east-1.amazonaws.com/cloudchainsinc.com/downloads/cc-release-0.5.11-windows.zip"
"linux": "https://s3.us-east-1.amazonaws.com/cloudchainsinc.com/downloads/cc-release-0.5.14-linux.zip",
"mac": "https://s3.us-east-1.amazonaws.com/cloudchainsinc.com/downloads/cc-release-0.5.14-osx.zip",
"win": "https://s3.us-east-1.amazonaws.com/cloudchainsinc.com/downloads/cc-release-0.5.14-windows.zip"
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "xlite",
"version": "1.0.2",
"version": "1.0.4",
"description": "xlite",
"private": true,
"main": "./dist/server/index.js",
Expand Down
20 changes: 19 additions & 1 deletion src/app/components/shared/modal-send.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,15 @@ const SendModal = ({ activeWallet, wallets, altCurrency, currencyMultipliers, ba
let avail = _.isNumber(Number(availableBalance)) ? bignumber(availableBalance).toNumber() : 0;
if (avail === 0)
throw new Error('No coin');

const tb = new TransactionBuilder(wallet.token().xbinfo);

// find non-spendable and dust inputs, remove from avail
const dust = coins
.filter(u => !u.spendable || tb.isDust(u.amount))
.reduce((a, b) => a + b.amount, 0);
avail = math.subtract(bignumber(avail), bignumber(dust)).toNumber();

tb.addRecipient(new Recipient({address: 'dummy', amount: avail, description }));
tb.fundTransaction(coins, true);
avail = math.subtract(bignumber(avail), bignumber(tb.getFees())).toNumber();
Expand All @@ -250,6 +258,10 @@ const SendModal = ({ activeWallet, wallets, altCurrency, currencyMultipliers, ba
setAltInputAmount(currencyLinter('0'));
updateTotals(0);
}
} else {
setInputAmount('');
setAltInputAmount(currencyLinter(''));
updateTotals(0);
}
setMaxSelected(!maxSelected);
} catch(err) {
Expand Down Expand Up @@ -383,7 +395,7 @@ const SendModal = ({ activeWallet, wallets, altCurrency, currencyMultipliers, ba
</Row>
</Row>

<Row style={{marginBottom: 2 * defaultMarginBottom}}>
<Row>
<Row style={{minWidth: 50, minHeight: 40, flexGrow: 1, flexBasis: 1}} justify={'space-between'}>
<CurrencyInput
inputStyle={{minWidth: 50}}
Expand All @@ -407,6 +419,12 @@ const SendModal = ({ activeWallet, wallets, altCurrency, currencyMultipliers, ba
</Row>
</Row>

<Row style={{marginBottom: 2 * defaultMarginBottom}}>
<Row style={{flexGrow: 1, flexBasis: 1}} justify={'start'}>
<div><span className={'lw-modal-description-label'}><Localize context={'sendModal'}>Available</Localize>:</span> <span className={'lw-modal-description-value'}>{availableBalance}</span></div>
</Row>
</Row>

<Row style={{fontSize, marginBottom: defaultMarginBottom * 2}}>
<div style={{flexGrow: 1, minHeight: 10}}>
<div><span className={'lw-modal-description-label'}><Localize context={'sendModal'}>Network fee</Localize>:</span> <span className={'lw-modal-description-value'}>{fees} {ticker}</span></div>
Expand Down
9 changes: 7 additions & 2 deletions src/server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,13 @@ autoUpdater.on('error', err => {
const checkForUpdates = async function() {
if(!isDev) {
try {
logger.info('Check for updates');
await autoUpdater.checkForUpdates();
const { version } = fs.readJsonSync(path.resolve(__dirname, '../../package.json'));
if(/-/.test(version)) {
logger.info('Test build. Not checking for updates.');
} else {
logger.info('Check for updates');
await autoUpdater.checkForUpdates();
}
} catch(err) {
logger.error(err.message + '\n' + err.stack);
}
Expand Down

0 comments on commit 60d501c

Please sign in to comment.