-
Notifications
You must be signed in to change notification settings - Fork 56
Conversation
ferni
commented
Feb 18, 2017
- Fix two bugs related to content failing to update between searches.
- New components_address template, which adds the identicon and turns green if the user owns it.
- Remove EthAccounts which is not needed.
- Upgrade ethereum-ens.js to 0.4.2 (remember to meteor npm up)
Since we rarely need the balance, we're better off just using web3.eth.accounts
registrar.unsealBid(bid, { | ||
from: mainAccount, | ||
from: web3.eth.accounts[0], // Any account can reveal |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
always checks if it exists!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's done at the top of the function.
let bid = template.data.bid.bid ? template.data.bid.bid : template.data.bid; | ||
MyBids.update({ _id: bid._id }, { $set: {revealing: true} }); | ||
|
||
TemplateVar.set(template, 'revealing', true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add the name to the template variable name, 'revealing-'+name
. This way, if the user clicks on another name while it waits for it to be revealed, the next page won't be in the same state
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't TemplateVar supposed to be template instance specific? I'll apply the suggested change anyway because why not.
@@ -13,6 +13,13 @@ Template['components_nameStatus'].onCreated(function() { | |||
try { | |||
registrar.getEntry(name, (err, entry) => { | |||
if(!err && entry) { | |||
let prevInfo = TemplateVar.get(template, 'nameInfo'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this redundant with line 40?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's stuff below that line that would be undesirable to run unless the name or status changes (The resetting of the TemplateVars, which cause a flicker if they're reset every second).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have a point in that maybe both checks could be unified. I'm not liking how this piece of code is shaping up, I feel it needs some reorganization. I think the home logic could be put in a separate template called "home", and set entry.mode to "home" when !name. And as a nice side-effect, you would also see the home screen when deleting the name with backspace.
@@ -34,7 +33,7 @@ Template['status-auction'].events({ | |||
} | |||
console.log('secret', secret); | |||
|
|||
if (accounts.length == 0) { | |||
if (web3.eth.accounts.length == 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If .accounts doesn't exist, checking it's length will return an error