Skip to content

Commit

Permalink
SpaceDapp: use getJoinSpacePrice as membershipPrice in getMembershipI…
Browse files Browse the repository at this point in the history
…nfo (#585)

The getMembershipPrice always returns the current price of the
membership, regardless of prepaid seats.
However, if a space has any prepaid seats left, a user won't be charged
this price.
When grabbing this price via getMembershipInfo, I think it makes more
sense to return the price considering prepaid seats. Easier to reason
about at the UI level - a user sees 0, they'll pay 0.

Alternatively I can just call getJoinSpacePrice where appropriate for
UI.
  • Loading branch information
salzbrenner authored Aug 1, 2024
1 parent 1e84b59 commit 094bc40
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/web3/src/v3/SpaceDapp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1130,7 +1130,7 @@ export class SpaceDapp implements ISpaceDapp {
}
const [price, limit, currency, feeRecipient, duration, totalSupply, pricingModule] =
await Promise.all([
space.Membership.read.getMembershipPrice(),
this.getJoinSpacePrice(spaceId),
space.Membership.read.getMembershipLimit(),
space.Membership.read.getMembershipCurrency(),
space.Ownable.read.owner(),
Expand Down

0 comments on commit 094bc40

Please sign in to comment.