Skip to content

Conversation

@ElRodrigote
Copy link
Collaborator

Fixes: STK-252

Description

  • Adds an optional chaining for safety navigation inside stack-order.ts to cover an edge case where it might break the app on a fast tab switch, to get the remaining funds of the stack.
  • Re-fetches all the user orders after successfully canceling a stack

Visual Evidence

https://www.loom.com/share/3dbdab016ac840b09b77f8e63076ced0?sid=d5e43b35-a395-4e2b-b6ae-9f3c3288924f

@vercel
Copy link

vercel bot commented Oct 21, 2024

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

Name Status Preview Comments Updated (UTC)
stackly-landing ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 22, 2024 9:52am

stacks.orders,
stacks.sort
)}
refetchAllOrders={fetchAllOrders}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why no use fetchAllOrders instead of refetchAllOrders?
cause it's seems to fetchAllOrders and not necessarily has the logic for re-fetching.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a refetch, right? Also we are using refetchStacks with the same logic

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly as Leo suggested, the idea for this prop is that, when we successfully cancel a stack and close the modal, we re-fetch the needed data:

  • The total orders count used for the tabs count (and the "All stacks count")
  • The displayable orders per page

Copy link
Collaborator

@Diogomartf Diogomartf Oct 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but we're passing it a fetchAllOrders function, I would keep the same name. As the function fetches the orders. Where we use it is the re-fetch thing.

I would keep the same name but okay with whatever you guys think its the best.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I get the semantic you suggest now, I'm ok with your suggestion, will push it in a bit.

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Oct 22, 2024

Deploying stackly-ui with  Cloudflare Pages  Cloudflare Pages

Latest commit: 84418c7
Status: ✅  Deploy successful!
Preview URL: https://5b7f2551.stackly-ui.pages.dev
Branch Preview URL: https://fix-stk-252-update-my-stack.stackly-ui.pages.dev

View logs

@ElRodrigote ElRodrigote merged commit 6c4db33 into develop Oct 22, 2024
@ElRodrigote ElRodrigote deleted the fix/stk-252-update-my-stack-tabs branch October 22, 2024 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants