Skip to content

Commit

Permalink
Apps: use consistent style across WebWorker scripts (aragon#876)
Browse files Browse the repository at this point in the history
  • Loading branch information
sohkai authored May 29, 2019
1 parent 1d5ec7a commit 1740159
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions app/src/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,18 @@ retryEvery(retry => {
async function initialize(tokenAddress) {
const token = app.external(tokenAddress, tokenAbi)

async function reducer(state, { address, event, returnValues }) {
let nextState = {
function reducer(state, { address, event, returnValues }) {
const nextState = {
...state,
}

if (event === events.SYNC_STATUS_SYNCING) {
nextState.isSyncing = true
return { ...nextState, isSyncing: true }
} else if (event === events.SYNC_STATUS_SYNCED) {
nextState.isSyncing = false
return { ...nextState, isSyncing: false }
}

// Token event
if (addressesEqual(address, tokenAddress)) {
switch (event) {
case 'ClaimedTokens':
Expand All @@ -70,11 +71,11 @@ async function initialize(tokenAddress) {
default:
return nextState
}
} else {
// Token Manager event
// TODO: add handlers for the vesting events from token Manager
}

// Token Manager event
// TODO: add handlers for the vesting events from token Manager

return nextState
}

Expand Down

0 comments on commit 1740159

Please sign in to comment.