Skip to content

fix(ledger): use parentAccountId if exists#376

Merged
Philippoes merged 1 commit intomainfrom
fix/ledger-parent-account-id
May 22, 2025
Merged

fix(ledger): use parentAccountId if exists#376
Philippoes merged 1 commit intomainfrom
fix/ledger-parent-account-id

Conversation

@petar-omni
Copy link
Copy Markdown
Contributor

Added

Description of new functionality, feature, or content that has been added in this pull request.

Changed

Description of the modifications made to existing functionality, feature, or content in this pull request. This could include changes to code, CI, documentation, etc.

Copilot AI review requested due to automatic review settings May 22, 2025 12:21
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 22, 2025

🦋 Changeset detected

Latest commit: a1141ab

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@stakekit/widget Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link
Copy Markdown

vercel Bot commented May 22, 2025

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

Name Status Preview Comments Updated (UTC)
staging-widget ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 22, 2025 0:58am
stakekit-widget ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 22, 2025 0:58am

@petar-omni petar-omni force-pushed the fix/ledger-parent-account-id branch from 0637aaa to 676e8aa Compare May 22, 2025 12:22
@petar-omni petar-omni requested a review from Philippoes May 22, 2025 12:22
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the ledger-connector to emit a parent account’s ID when available instead of always using the account’s own ID.

  • Changed the $currentAccountId observable to prefer parentAccountId.
  • Adjusted the pipe to inline the fallback logic.
Comments suppressed due to low confidence (1)

packages/widget/src/providers/ledger/ledger-connector.ts:48

  • Add a unit test case where an account has a parentAccountId to verify that the observable emits the parent ID rather than the account’s own id.
map((v) => v?.parentAccountId || v?.id)

Comment thread packages/widget/src/providers/ledger/ledger-connector.ts Outdated
Comment thread packages/widget/src/providers/ledger/ledger-connector.ts
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the ledger connector logic to prioritize using parentAccountId for the current account when available.

  • Updates the RXJS pipe mapping logic in the ledger connector to use parentAccountId if it exists, otherwise fallback to id.
  • Updates the changeset file to reflect the patch version and title.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
packages/widget/src/providers/ledger/ledger-connector.ts Adjusted logic to use parentAccountId if exists
.changeset/warm-hoops-enter.md Updated changeset message to match new logic

Comment thread packages/widget/src/providers/ledger/ledger-connector.ts
@Philippoes Philippoes merged commit 92e2bbe into main May 22, 2025
7 checks passed
@Philippoes Philippoes deleted the fix/ledger-parent-account-id branch May 22, 2025 15:57
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