Fix kredits balance handling #104

Merged
bumi merged 3 commits from feature/handle-kredits-balances into master 2019-04-19 13:44:36 +00:00
2 changed files with 2 additions and 10 deletions
Showing only changes of commit 562a8d159b - Show all commits
+1 -1
View File
1
@@ -112,7 +112,7 @@ export default Service.extend({
totalSupply: computed(function() {
return this.kredits.Token.functions.totalSupply().then(total => {
return Promise.resolve(formatKredits(total));
return formatKredits(total);
})
}),
+1 -9
View File
@@ -1,14 +1,6 @@
import { computed } from '@ember/object';
bumi commented 2019-04-19 09:48:17 +00:00 (Migrated from github.com)
Review

how do I do that import here? somehow I did not get this working.

how do I do that import here? somehow I did not get this working.
fsmanuel commented 2019-04-19 10:08:31 +00:00 (Migrated from github.com)
Review

Without .js or a relative import: import formatKredits from '../format-kredits';

Without `.js` or a relative import: `import formatKredits from '../format-kredits';`
bumi commented 2019-04-19 13:43:40 +00:00 (Migrated from github.com)
Review

ahhh, probably the only option that I did not try...thx.

ahhh, probably the only option that I did not try...thx.
import ethers from 'npm:ethers';
//import formatKredits from 'kredits-web/utils/format-kredits.js';
function formatKredits(value, options) {
let etherValue = ethers.utils.formatEther(value);
if (!options.decimals) {
etherValue = parseInt(etherValue).toString();
}
return etherValue;
}
import formatKredits from 'kredits-web/utils/format-kredits';
export default function(dependentKey, options = {}) {
return computed(dependentKey, {