Skip to content

Commit b030701

Browse files
authored
Merge pull request #30 from celo-tools/1.0.1-dev
2 parents f4f5b60 + 38eebaf commit b030701

16 files changed

Lines changed: 127 additions & 51 deletions

.github/workflows/bundle-desktop.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,5 @@ jobs:
6060
name: celowallet-artifacts
6161
path: |
6262
dist-electron/*-mac*.dmg
63-
dist-electron/*-mac*.zip
6463
dist-electron/*-linux*.AppImage
6564
dist-electron/*-win*.exe

electron-builder.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ mac:
2121
entitlementsInherit: electron/build/mac/entitlements.plist
2222
target:
2323
- dmg
24-
- zip
2524

2625
linux:
2726
artifactName: ${productName}-${version}-${os}-${arch}.${ext}

package-electron.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "celo-web-wallet",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"description": "A lightweight web and desktop wallet for the Celo network",
55
"main": "main.js",
66
"keywords": [

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "celo-web-wallet",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"description": "A lightweight web and desktop wallet for the Celo network",
55
"keywords": [
66
"Celo",

src/components/modal/useNavHintModal.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export function useNavHintModal(
1212
body: string,
1313
navLabel: string,
1414
navTarget: string,
15+
navState?: Record<string, unknown>,
1516
onClose?: () => void
1617
) {
1718
const navigate = useNavigate()
@@ -29,7 +30,7 @@ export function useNavHintModal(
2930
color: Color.altGrey,
3031
}
3132
const onActionClick = (action: ModalAction) => {
32-
if (action.key === 'nav') navigate(navTarget)
33+
if (action.key === 'nav') navigate(navTarget, navState ? { state: navState } : undefined)
3334
if (onClose) onClose()
3435
closeModal()
3536
}

src/consts.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export const ACCOUNT_UNLOCK_TIMEOUT = 600000 // 10 minutes
3030
export const BALANCE_STALE_TIME = 15000 // 15 seconds
3131
export const GAS_PRICE_STALE_TIME = 10000 // 10 seconds
3232
export const EXCHANGE_RATE_STALE_TIME = 15000 // 15 seconds
33-
export const ACCOUNT_STATUS_STALE_TIME = 86400000 // 1 day
33+
export const ACCOUNT_STATUS_STALE_TIME = 43200000 // 12 hours
3434
export const VALIDATOR_LIST_STALE_TIME = 86400000 // 1 day
3535
export const VALIDATOR_VOTES_STALE_TIME = 300000 // 5 minutes
3636
export const VALIDATOR_ACTIVATABLE_STALE_TIME = 43200000 // 12 hours

src/features/home/HomeScreen.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { HeaderSection } from 'src/features/home/HeaderSection'
1313
import { HeaderSectionEmpty } from 'src/features/home/HeaderSectionEmpty'
1414
import { toggleHomeHeaderDismissed } from 'src/features/settings/settingsSlice'
1515
import { PriceChartCelo } from 'src/features/tokenPrice/PriceChartCelo'
16+
import { StakeActionType } from 'src/features/validators/types'
1617
import { dismissActivatableReminder } from 'src/features/validators/validatorsSlice'
1718
import { useAreBalancesEmpty } from 'src/features/wallet/utils'
1819
import { Color } from 'src/styles/Color'
@@ -61,16 +62,18 @@ export function HomeScreen() {
6162
// END PIN MIGRATION
6263

6364
// Detect if user has unactivated staking votes
64-
const { status: hasActivatableVotes, reminderDismissed: votesReminderDismissed } = useSelector(
65-
(state: RootState) => state.validators.hasActivatable
66-
)
67-
const showActivateModal = hasActivatableVotes && !votesReminderDismissed
65+
const hasActivatable = useSelector((state: RootState) => state.validators.hasActivatable)
66+
const showActivateModal =
67+
hasActivatable.status &&
68+
hasActivatable.groupAddresses.length &&
69+
!hasActivatable.reminderDismissed
6870
useNavHintModal(
6971
showActivateModal,
7072
'Activate Your Votes!',
7173
'You have pending validator votes that are ready to be activated. They must be activated to start earning staking rewards.',
7274
'Activate',
7375
'/stake',
76+
{ groupAddress: hasActivatable.groupAddresses[0], action: StakeActionType.Activate },
7477
() => {
7578
dispatch(dismissActivatableReminder())
7679
}

src/features/home/Tips.ts

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
export const Tips = [
1+
import { config } from 'src/config'
2+
3+
const Tips = [
24
[
35
'Transaction fees can be paid in any currency but they are smaller when paid with CELO.',
46
'Consider keeping some CELO in your account to pay for fees. It will be used by default.',
@@ -17,20 +19,24 @@ export const Tips = [
1719
],
1820
[
1921
'Your wallet can be imported in many places at once.',
20-
'For example, use your Account Key to load it into the Valora mobile app.',
21-
],
22-
[
23-
'Using this wallet in a browser is only safe for small accounts or Ledger users.',
24-
'For large accounts, downloading the Desktop App is strongly recommended.',
22+
'For example, you can import your Account Key into the Valora mobile app.',
2523
],
2624
[
2725
'You can lock CELO to participate in Celo network elections and governance.',
2826
'Voting for validators that are elected will earn you free CELO rewards.',
2927
],
3028
]
3129

30+
const WebTips = [
31+
...Tips,
32+
[
33+
'Using this wallet in a browser is only safe for small accounts or Ledger users.',
34+
'For large accounts, downloading the Desktop App is strongly recommended.',
35+
],
36+
]
37+
3238
export function useDailyTip() {
33-
// TODO save the starting date in storage so tips can be cycled through in order from the first
39+
const tips = config.isElectron ? Tips : WebTips
3440
const date = new Date().getDate()
35-
return Tips[date % Tips.length]
41+
return tips[date % tips.length]
3642
}

src/features/ledger/LedgerSigner.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1+
import 'src/features/ledger/buffer' // Must be the first import
12
import { CeloTransactionRequest, serializeCeloTransaction } from '@celo-tools/celo-ethers-wrapper'
23
import { TransportError, TransportStatusError } from '@ledgerhq/errors'
34
import { BigNumber, providers, Signer, utils } from 'ethers'
45
import { config } from 'src/config'
56
import { CELO_LEDGER_APP_MIN_VERSION } from 'src/consts'
6-
import 'src/features/ledger/buffer' // Must be the first import
77
import { CeloLedgerApp } from 'src/features/ledger/CeloLedgerApp'
88
import { getLedgerTransport } from 'src/features/ledger/ledgerTransport'
99
import { getTokenData } from 'src/features/ledger/tokenData'

src/features/lock/LockFormScreen.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ export function LockFormScreen() {
6363
handleSubmit,
6464
setValues,
6565
resetValues,
66+
resetErrors,
6667
} = useCustomForm<LockTokenForm>(getInitialValues(tx), onSubmit, validateForm)
6768

6869
// Keep form in sync with tx state
@@ -83,6 +84,7 @@ export function LockFormScreen() {
8384
autoSetAmount = '0'
8485
}
8586
setValues({ ...values, [name]: value, amount: autoSetAmount })
87+
resetErrors()
8688
}
8789

8890
const onUseMax = () => {
@@ -96,6 +98,7 @@ export function LockFormScreen() {
9698
maxAmount = fromWeiRounded(pendingFree, Currency.CELO, true)
9799
}
98100
setValues({ ...values, amount: maxAmount })
101+
resetErrors()
99102
}
100103

101104
const summaryData = useMemo(() => getSummaryChartData(balances), [balances])

0 commit comments

Comments
 (0)