Cleanup
This commit is contained in:
@@ -112,7 +112,7 @@ export default Service.extend({
|
|||||||
|
|
||||||
totalSupply: computed(function() {
|
totalSupply: computed(function() {
|
||||||
return this.kredits.Token.functions.totalSupply().then(total => {
|
return this.kredits.Token.functions.totalSupply().then(total => {
|
||||||
return Promise.resolve(formatKredits(total));
|
return formatKredits(total);
|
||||||
})
|
})
|
||||||
}),
|
}),
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,6 @@
|
|||||||
import { computed } from '@ember/object';
|
import { computed } from '@ember/object';
|
||||||
import ethers from 'npm:ethers';
|
import ethers from 'npm:ethers';
|
||||||
//import formatKredits from 'kredits-web/utils/format-kredits.js';
|
import formatKredits from 'kredits-web/utils/format-kredits';
|
||||||
|
|
||||||
function formatKredits(value, options) {
|
|
||||||
let etherValue = ethers.utils.formatEther(value);
|
|
||||||
if (!options.decimals) {
|
|
||||||
etherValue = parseInt(etherValue).toString();
|
|
||||||
}
|
|
||||||
return etherValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
export default function(dependentKey, options = {}) {
|
export default function(dependentKey, options = {}) {
|
||||||
return computed(dependentKey, {
|
return computed(dependentKey, {
|
||||||
|
|||||||
Reference in New Issue
Block a user