Skip to content

Commit

Permalink
Feature/rewards claiming (#110)
Browse files Browse the repository at this point in the history
* Polkaswap layout redesign (#98)

* pss-498 header redesign

* wip pss-496

* style fixes

* add HelpDialog component

* reexport package.json

* exchange routing fix

* add Rewards stub with coming soon text

* refactoring SidebarItemContent

* refactoring styles

* add FAUCET_URL to env.json

* fixes after review

* fix sidebar item hover css

* fix disabled item css

* Move bridge functionality (#103)

* pss-498 header redesign

* wip pss-496

* style fixes

* add HelpDialog component

* reexport package.json

* exchange routing fix

* add Rewards stub with coming soon text

* refactoring SidebarItemContent

* refactoring styles

* add FAUCET_URL to env.json

* fixes after review

* Move bridge functionality

Co-authored-by: Nikita-Polyakov <[email protected]>

* Update wallet & api

* PSS-524: Bridge (#107)

* pss-498 header redesign

* wip pss-496

* style fixes

* add HelpDialog component
* reexport package.json
* exchange routing fix
* add Rewards stub with coming soon text
* refactoring SidebarItemContent
* refactoring styles
* add FAUCET_URL to env.json
* fixes after review
* Move bridge functionality
* Bridge: Updated unauthorized routes.
* Updated Generic Page Header, updated Bridge screens.
* Fixed token icons.
* Bridge: Updated styles.
* Updated tooltips.
* Removed unused token images.
* Refactored due to PR comments.

Co-authored-by: Nikita-Polyakov <[email protected]>
Co-authored-by: Stefan Popov <[email protected]>

* wip initial screen

* token row wip

* Fix/pss 539 metamsk lock issue (#108)

* improve subscribers

* add check account is connected

* Fix/balance flickering (#109)

* wip update balance flow

* refactoring views and store modules

* remove unused code

* fixes after review

* add TokensRow component

* add rewards amount components

* add ordinal translations

* rename actions

* Update yarn.lock

* wip rewards states

* fix types

* wip rewards parsing

* update states

* add states flags

* remove comments

* sync yarn.lock

* refactoring bridge to use WalletConnectMixin

* css fixes

* change account flow

* save signature

* convert address to hex

* notification for no rewards

* fetch network fee for claiming rewards

* reset rewards for testing

* add types to store

* notification

* disconnect process

* add types for components

* fixes

* improve loading state

* improve notification

* success state ui update

* fetch rewards and network fee parallel

* improve error message

* unsubscribe ethereum events

Co-authored-by: Stefan Popov <[email protected]>
Co-authored-by: Alex Natalia <[email protected]>
  • Loading branch information
3 people committed Mar 30, 2021
1 parent 8d1dfd7 commit e4f2332
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/utils/web3-util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,11 @@ async function onConnectWallet (url = 'https://cloudflare-eth.com'): Promise<str
async function getAccount (): Promise<string> {
try {
const web3Instance = await getInstance()
const accounts = await web3Instance.eth.getAccounts()
let accounts = await web3Instance.eth.getAccounts()

if (!Array.isArray(accounts) || !accounts.length) {
accounts = await web3Instance.eth.requestAccounts()
}

return accounts.length ? accounts[0] : ''
} catch (error) {
Expand Down

0 comments on commit e4f2332

Please sign in to comment.