Skip to content

Commit

Permalink
fix(widget): improve PartnerFeeDiscarded error (#4405)
Browse files Browse the repository at this point in the history
  • Loading branch information
shoom3301 authored May 3, 2024
1 parent 291003b commit 2053e98
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export function InjectedWidgetUpdater() {
const [
{
errors: validationErrors,
params: { partnerFee },
params: { partnerFee, appCode },
},
updateParams,
] = useAtom(injectedWidgetParamsAtom)
Expand Down Expand Up @@ -108,9 +108,11 @@ export function InjectedWidgetUpdater() {

// Log an error when partnerFee was set and then discarded
useEffect(() => {
if (prevPartnerFee || !partnerFee) {
if (!appCode) return

if (prevPartnerFee && !partnerFee) {
const sentryError = Object.assign(
new Error(`BPS: ${prevPartnerFee?.bps}, recipient: ${prevPartnerFee?.recipient}`),
new Error(`AppCode: ${appCode}, BPS: ${prevPartnerFee.bps}, recipient: ${prevPartnerFee.recipient}`),
{
name: 'PartnerFeeDiscarded',
}
Expand All @@ -122,7 +124,7 @@ export function InjectedWidgetUpdater() {
},
})
}
}, [partnerFee, prevPartnerFee])
}, [appCode, partnerFee, prevPartnerFee])

return (
<>
Expand Down

0 comments on commit 2053e98

Please sign in to comment.