Skip to content

Commit

Permalink
fix: hover event only affects the change in rating status
Browse files Browse the repository at this point in the history
  • Loading branch information
Ponchimeow authored and LoisChen68 committed Jan 16, 2025
1 parent 8610c7d commit 84ea8ff
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions src/components/sale/SalesLeadTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -597,14 +597,26 @@ const SalesLeadTable: React.VFC<{
salesLeadMembers: updateSalesLeadMembers,
})
}}
onStarHoverOut={() =>
onStarHoverOut={() => {
const oldSalesLeadMember = defaultSalesLeadMembers?.find(
defaultSalesLeadMember => defaultSalesLeadMember.id === lead.id,
)
salesLeadMembersData &&
defaultSalesLeadMembers &&
onSaleLeadChange?.({
...salesLeadMembersData,
salesLeadMembers: defaultSalesLeadMembers,
})
}
defaultSalesLeadMembers &&
onSaleLeadChange?.({
...salesLeadMembersData,
salesLeadMembers: [
...salesLeadMembersData.salesLeadMembers.map(salesLeadMember =>
salesLeadMember.id === lead.id
? {
...salesLeadMember,
rating: oldSalesLeadMember?.rating || 0,
}
: salesLeadMember,
),
],
})
}}
/>
</div>
) : null}
Expand Down

0 comments on commit 84ea8ff

Please sign in to comment.