Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #508: Bug: View as another wallet #573

Merged
merged 1 commit into from
Jun 13, 2024

Conversation

jahabeebs
Copy link
Member

closes #508

Description

There were two problems causing the user not to be able to see vaults while seeing the app as another user

  1. We were using history.push to navigate to the vaults list for a different user, but history.push is internal routing for react so it was conserving the current wallet's address in the state and causing issues when trying to fetch the current user's vaults and the different user's vaults at the same time
  2. In state management we were sometimes setting setSingleSafe to a null value, which doesn't make any sense and was causing the vault to be set to null when viewed as another user (I'm not sure exactly why it was coming as null once it was fetched more than once but we can prevent this anyway)

I added the following fixes:

  • When window.location is available we use window.location.assign to move to the new route with the other user's address. This is kind of like doing a hard refresh while moving routes which prevents us from having issues with the current connected user's wallet from interfering with the new vaults we're trying to fetch
  • Added an if (!payload) check to state management to make sure we don't set a fetched single vault as null. If a user connects their wallet while viewing the vault as another user (or if the wallet isn't connected at all) it will now properly fetch the vault
  • Some cleanup of VaultDetails like making sure the dependency arrays are specific enough and returning early in fetchSingleVaultData if the function should finish

Screenshots

View app as certain user -> navigates to certain user's vault list -> we open the certain user's vault list with our wallet disconnected -> we connect our wallet and can still see the vault

newflow.mp4

@jahabeebs jahabeebs self-assigned this Jun 12, 2024
Copy link

vercel bot commented Jun 12, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
od-app ✅ Ready (Inspect) Visit Preview Jun 12, 2024 11:49pm
od-app-hai ✅ Ready (Inspect) Visit Preview Jun 12, 2024 11:49pm
od-app-testnet ✅ Ready (Inspect) Visit Preview Jun 12, 2024 11:49pm

@jahabeebs jahabeebs merged commit 5098c00 into dev Jun 13, 2024
8 checks passed
pi0neerpat added a commit that referenced this pull request Jun 21, 2024
* Fix fuul crashing the app

* lint cleanup

* Bolts page (#521)

* scaffold bolts page

* fix input on mobile

* Fix stroke-width

* setup quest blocks

* cleanup blocks

* Fetching fuul data

* cleanup

* lint

* Marketplace: Data Fetching (#518)

* marketplace data fetching

* fixed

* listings data

* data

* all data

* account flag

* fix array

* fixes

* cleanup (#529)

* add fuul sendPageview

* fix bolts page styles (#531)

* Issue #451. HAI warning Banner  (#516)

* banner for hai user

* prettier

* make height fixed and border-bottom

* height 60

* Issue #510. Marketplace: NFV Listing Card (#527)

* header

* fix id

* add cards component

* basic data and styles

* card right side style

* data we need

* Add Table

Co-authored-by: Iana <alekseevaiana@users.noreply.github.com>

* basic styles

* clean up

* mock data

* change background

* add image column

* cleanup

* cleanup

* hook everything up

* fix svg size

* fix svg size

* data fetchingf

* Add subgraph query

* hooked up with most data

* fix

* fix

* liq data

* got all data

* add dollar size

* add scroll

* scale svg and headers one line

* fix table ids

* mobile fixes

* Update titles

* styling mobile changes

* add filtering, sorting

* svg change

* svg center

* ui tweaks

---------

Co-authored-by: Patrick Gallagher <blockchainbuddha@gmail.com>
Co-authored-by: Iana <alekseevaiana@users.noreply.github.com>
Co-authored-by: jahabeebs <jahgoreds@gmail.com>
Co-authored-by: Sero <69639595+Seroxdesign@users.noreply.github.com>

* index.html

* cleanup

* Issue #541: Redundant fetchAnalyticsData (#545)

* useAnalyticsData

* more useAnalyticsData refactoring

* Issue #409: Reduce redundant RPC calls (#554)

* remove initgeb, fix unneeded step2 setting, fix invalid bn error

* memoize

* more fixes

* change sidenote color and fweight (#558)

* Feature/bridge (#326)

* util

* chain IDs, and url params

* bridge page

* building form

* bridge stuff

* state management

* set up state for bridge (#355)

* set up state for bridge

* hook up state, clear lint and prettier

* bridge UI (#479)

* bridge UI

* b

* hooked up

* b

* check balance and popup (#495)

* check balance and popup

* done

* fix

* rem

* Fetch Collateral Balances for Bridge table (#513)

* table data

* base

* fixes

* address

* new rpc

* successfully fetch balances for specific chain

---------

Co-authored-by: Patrick Gallagher <blockchainbuddha@gmail.com>

* Issue #503. Bridge: Main interaction component. (#514)

* header basic

* content

* styling

* Update BridgeFundsForm.tsx

* elements width

* cleanup

* change btn width

* prettier

---------

Co-authored-by: Patrick Gallagher <blockchainbuddha@gmail.com>

* Issue #504. Bridge: Table interaction (#540)

* header basic

* content

* styling

* basic style

* hg item, add span and tooltip

* add functionality to table, add bridge details to create and modify vault page

---------

Co-authored-by: Sero <69639595+Seroxdesign@users.noreply.github.com>

* Issue #507. Bridge: low gas improvements (#546)

* style

* popup state

* low gas modal closing

* low gas modal

---------

Co-authored-by: Sero <69639595+Seroxdesign@users.noreply.github.com>

* debugging

* copy text changes

* fix missing bolts

* fix mainnet/ethereum mismatch, update bolts to be uppercase, fixed type issues

* Update NavLinks.tsx

* Issue # 547 QA Bridge page (#553)

* create vault link to bridge

* modify vault link to bridge

* row style change

* add icons to tokens

* basic tabs

* fix tokens error and style tabs

* tokens, balance, loader

* format balance

* loading balance

* tokens logos update

* cleanup

* add network icons

* rm WETH

* update tokens

* updating balances when switching networks

* no loader if account not connencted

* fo not show undefined balance

* cleanup

* item disabled

* tabs bg and width

* tabs mobile

* btn alighnment

* rm column gap for mobile

* balances as hash map

* take changes from feature/bridge just for one file

* cleanup and fix

* cleanup

* show fixed balance

* fix

* cleaun console log

* text copy

* Get ETH working on polygon

* cleanup

* Final UX changes

---------

Co-authored-by: Patrick Gallagher <blockchainbuddha@gmail.com>

---------

Co-authored-by: Patrick Gallagher <blockchainbuddha@gmail.com>
Co-authored-by: Iana <36742189+alekseevaiana@users.noreply.github.com>
Co-authored-by: jahabeebs <jahgoreds@gmail.com>

* fix decimals, balance issue (#566)

* fix max debt (#569)

* NFV corner radius #525 (#571)

* console log errors

* fix bug with no chain

* add corners, fix paddings

* border radius bottom container

* width max

* prettier

* Issue # 532 Bolts: token logos to be React components w/dynamic widths and heights (#565)

* util

* chain IDs, and url params

* bridge page

* building form

* bridge stuff

* state management

* set up state for bridge (#355)

* set up state for bridge

* hook up state, clear lint and prettier

* bridge UI (#479)

* bridge UI

* b

* hooked up

* b

* check balance and popup (#495)

* check balance and popup

* done

* fix

* rem

* Fetch Collateral Balances for Bridge table (#513)

* table data

* base

* fixes

* address

* new rpc

* successfully fetch balances for specific chain

---------

Co-authored-by: Patrick Gallagher <blockchainbuddha@gmail.com>

* Issue #503. Bridge: Main interaction component. (#514)

* header basic

* content

* styling

* Update BridgeFundsForm.tsx

* elements width

* cleanup

* change btn width

* prettier

---------

Co-authored-by: Patrick Gallagher <blockchainbuddha@gmail.com>

* Issue #504. Bridge: Table interaction (#540)

* header basic

* content

* styling

* basic style

* hg item, add span and tooltip

* add functionality to table, add bridge details to create and modify vault page

---------

Co-authored-by: Sero <69639595+Seroxdesign@users.noreply.github.com>

* Issue #507. Bridge: low gas improvements (#546)

* style

* popup state

* low gas modal closing

* low gas modal

---------

Co-authored-by: Sero <69639595+Seroxdesign@users.noreply.github.com>

* debugging

* copy text changes

* create vault link to bridge

* modify vault link to bridge

* row style change

* add icons to tokens

* basic tabs

* fix tokens error and style tabs

* tokens, balance, loader

* format balance

* loading balance

* tokens logos update

* cleanup

* add network icons

* rm WETH

* update tokens

* updating balances when switching networks

* no loader if account not connencted

* fo not show undefined balance

* cleanup

* item disabled

* tabs bg and width

* tabs mobile

* btn alighnment

* fix missing bolts

* fix mainnet/ethereum mismatch, update bolts to be uppercase, fixed type issues

* rm column gap for mobile

* balances as hash map

* take changes from feature/bridge just for one file

* cleanup and fix

* cleanup

* show fixed balance

* fix

* cleaun console log

* od logo as component

* arb token component

* Token Icon component

* new od odg tokens

* use new Token Component

* cleanup

* fix lost token

---------

Co-authored-by: Sero <69639595+Seroxdesign@users.noreply.github.com>
Co-authored-by: Patrick Gallagher <blockchainbuddha@gmail.com>
Co-authored-by: jahabeebs <jahgoreds@gmail.com>

* Issue #535: Bolts Leaderboard (#570)

* add leaderboard

* leaderboard styling improvements

* more leaderboard changes

* font sizes

* pillars fix

* leaderboard styling

* final leaderboard changes

* cleanup

* remove address

* format

* Issue #538 Bolts- Header box (#568)

* util

* chain IDs, and url params

* bridge page

* building form

* bridge stuff

* state management

* set up state for bridge (#355)

* set up state for bridge

* hook up state, clear lint and prettier

* bridge UI (#479)

* bridge UI

* b

* hooked up

* b

* check balance and popup (#495)

* check balance and popup

* done

* fix

* rem

* Fetch Collateral Balances for Bridge table (#513)

* table data

* base

* fixes

* address

* new rpc

* successfully fetch balances for specific chain

---------

Co-authored-by: Patrick Gallagher <blockchainbuddha@gmail.com>

* Issue #503. Bridge: Main interaction component. (#514)

* header basic

* content

* styling

* Update BridgeFundsForm.tsx

* elements width

* cleanup

* change btn width

* prettier

---------

Co-authored-by: Patrick Gallagher <blockchainbuddha@gmail.com>

* Issue #504. Bridge: Table interaction (#540)

* header basic

* content

* styling

* basic style

* hg item, add span and tooltip

* add functionality to table, add bridge details to create and modify vault page

---------

Co-authored-by: Sero <69639595+Seroxdesign@users.noreply.github.com>

* Issue #507. Bridge: low gas improvements (#546)

* style

* popup state

* low gas modal closing

* low gas modal

---------

Co-authored-by: Sero <69639595+Seroxdesign@users.noreply.github.com>

* debugging

* copy text changes

* create vault link to bridge

* modify vault link to bridge

* row style change

* add icons to tokens

* basic tabs

* fix tokens error and style tabs

* tokens, balance, loader

* format balance

* loading balance

* tokens logos update

* cleanup

* add network icons

* rm WETH

* update tokens

* updating balances when switching networks

* no loader if account not connencted

* fo not show undefined balance

* cleanup

* item disabled

* tabs bg and width

* tabs mobile

* btn alighnment

* fix missing bolts

* fix mainnet/ethereum mismatch, update bolts to be uppercase, fixed type issues

* rm column gap for mobile

* balances as hash map

* take changes from feature/bridge just for one file

* cleanup and fix

* cleanup

* show fixed balance

* fix

* cleaun console log

* od logo as component

* arb token component

* Token Icon component

* new od odg tokens

* use new Token Component

* cleanup

* fix lost token

* message box

* message box cleanup

* leaderboard component

* rm leaderboard

* more styling

* mobile styling

---------

Co-authored-by: Sero <69639595+Seroxdesign@users.noreply.github.com>
Co-authored-by: Patrick Gallagher <blockchainbuddha@gmail.com>
Co-authored-by: jahabeebs <jahgoreds@gmail.com>

* Issue #534 Bolts: mobile cleanup #2  (#567)

* util

* chain IDs, and url params

* bridge page

* building form

* bridge stuff

* state management

* set up state for bridge (#355)

* set up state for bridge

* hook up state, clear lint and prettier

* bridge UI (#479)

* bridge UI

* b

* hooked up

* b

* check balance and popup (#495)

* check balance and popup

* done

* fix

* rem

* Fetch Collateral Balances for Bridge table (#513)

* table data

* base

* fixes

* address

* new rpc

* successfully fetch balances for specific chain

---------

Co-authored-by: Patrick Gallagher <blockchainbuddha@gmail.com>

* Issue #503. Bridge: Main interaction component. (#514)

* header basic

* content

* styling

* Update BridgeFundsForm.tsx

* elements width

* cleanup

* change btn width

* prettier

---------

Co-authored-by: Patrick Gallagher <blockchainbuddha@gmail.com>

* Issue #504. Bridge: Table interaction (#540)

* header basic

* content

* styling

* basic style

* hg item, add span and tooltip

* add functionality to table, add bridge details to create and modify vault page

---------

Co-authored-by: Sero <69639595+Seroxdesign@users.noreply.github.com>

* Issue #507. Bridge: low gas improvements (#546)

* style

* popup state

* low gas modal closing

* low gas modal

---------

Co-authored-by: Sero <69639595+Seroxdesign@users.noreply.github.com>

* debugging

* copy text changes

* create vault link to bridge

* modify vault link to bridge

* row style change

* add icons to tokens

* basic tabs

* fix tokens error and style tabs

* tokens, balance, loader

* format balance

* loading balance

* tokens logos update

* cleanup

* add network icons

* rm WETH

* update tokens

* updating balances when switching networks

* no loader if account not connencted

* fo not show undefined balance

* cleanup

* item disabled

* tabs bg and width

* tabs mobile

* btn alighnment

* fix missing bolts

* fix mainnet/ethereum mismatch, update bolts to be uppercase, fixed type issues

* rm column gap for mobile

* balances as hash map

* take changes from feature/bridge just for one file

* cleanup and fix

* cleanup

* show fixed balance

* fix

* cleaun console log

* od logo as component

* arb token component

* Token Icon component

* new od odg tokens

* use new Token Component

* cleanup

* fix lost token

* quest block mobile clean up

* clean up

* prettier

* group tokens icons

* change tokens width

* change layout

* change tokens in popup

* update tokens on side menu

* prettier

* lint

* icons inline

* return wallet icon

* fix alignment

* inline tokens with text

* align wallet popup

* clean up popups

* align popup lower

* add max width for container

---------

Co-authored-by: Sero <69639595+Seroxdesign@users.noreply.github.com>
Co-authored-by: Patrick Gallagher <blockchainbuddha@gmail.com>
Co-authored-by: jahabeebs <jahgoreds@gmail.com>

* fix view as another wallet (#573)

* Issue #548: QA: Fuul SDK (#577)

* fuul logic

* no type coercion

* Remove unused images (#576)

* rm imgs a-g

* rm rest imgs

* rm some preload images

* Issue 551. QA: Mobile side menu (#575)

* rm stepper for mobile

* move connect wallet btn

* clean account balange arrangement

* put info to the top

* fix right popup

* DollarValueInner component

* clean up component

* cleanup

* lint fix

* cleanup

* Issue #497. NFV owner bug. (#515)

* use safe account address

* fix nfv owner logic

* ahow owner address

* create function get owner address

* cancel prev logic

---------

Co-authored-by: jahabeebs <jahgoreds@gmail.com>

* update sdk to 1.7.3-rc.1

* Bump braces from 3.0.2 to 3.0.3 (#584)

Bumps [braces](https://github.com/micromatch/braces) from 3.0.2 to 3.0.3.
- [Changelog](https://github.com/micromatch/braces/blob/master/CHANGELOG.md)
- [Commits](micromatch/braces@3.0.2...3.0.3)

---
updated-dependencies:
- dependency-name: braces
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Issue #562: Bolts: Display per-quest points  (#572)

* points per quest

* local testing

* Add conversion ids

* bolts amount formatting

* highlight rows

* cleanup

* use production bot domain

* remove localhost connect-src

* add multipliers section

* lint

---------

Co-authored-by: Patrick Gallagher <blockchainbuddha@gmail.com>

* Issue #512: ENS for addresses (#579)

* useAddress hook

* isMounted issue

* update rpcs to be constants, add to env example

* fix in right place

* v1.7.2

* staging fixes (#586)

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Sero <69639595+Seroxdesign@users.noreply.github.com>
Co-authored-by: Jacob Habib <47253537+jahabeebs@users.noreply.github.com>
Co-authored-by: Iana <36742189+alekseevaiana@users.noreply.github.com>
Co-authored-by: Iana <alekseevaiana@users.noreply.github.com>
Co-authored-by: jahabeebs <jahgoreds@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
@pi0neerpat pi0neerpat deleted the fix/508-view-as-another-wallet branch June 26, 2024 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: View as another wallet
2 participants