Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

fix payoutMethod logic, update queue name to "handle-balance-available"

Steven Tey7709b6939769
diff --git a/apps/web/app/(ee)/api/stripe/connect/webhook/account-updated.ts b/apps/web/app/(ee)/api/stripe/connect/webhook/account-updated.ts
index fd4da17116..80d9406af4 100644
--- a/apps/web/app/(ee)/api/stripe/connect/webhook/account-updated.ts
+++ b/apps/web/app/(ee)/api/stripe/connect/webhook/account-updated.ts
@@ -9,7 +9,7 @@ import { APP_DOMAIN_WITH_NGROK, log } from "@dub/utils";
import Stripe from "stripe";
const queue = qstash.queue({
- queueName: "withdraw-stripe-balance",
+ queueName: "handle-balance-available",
});
export async function accountUpdated(event: Stripe.Event) {
diff --git a/apps/web/app/(ee)/api/stripe/connect/webhook/balance-available.ts b/apps/web/app/(ee)/api/stripe/connect/webhook/balance-available.ts
index 176b6033bb..ce985c5dd0 100644
--- a/apps/web/app/(ee)/api/stripe/connect/webhook/balance-available.ts
+++ b/apps/web/app/(ee)/api/stripe/connect/webhook/balance-available.ts
@@ -3,7 +3,7 @@ import { APP_DOMAIN_WITH_NGROK } from "@dub/utils";
import Stripe from "stripe";
const queue = qstash.queue({
- queueName: "withdraw-stripe-balance",
+ queueName: "handle-balance-available",
});
export async function balanceAvailable(event: Stripe.Event) {
diff --git a/apps/web/lib/swr/use-partner-profile.ts b/apps/web/lib/swr/use-partner-profile.ts
index de6867e6ba..29d103d1ca 100644
--- a/apps/web/lib/swr/use-partner-profile.ts
+++ b/apps/web/lib/swr/use-partner-profile.ts
@@ -28,9 +28,9 @@ export default function usePartnerProfile() {
return {
partner,
payoutMethod: partner?.country
- ? partner.country in PAYPAL_SUPPORTED_COUNTRIES
+ ? PAYPAL_SUPPORTED_COUNTRIES.includes(partner.country)
? "paypal"
- : partner.country in CONNECT_SUPPORTED_COUNTRIES
+ : CONNECT_SUPPORTED_COUNTRIES.includes(partner.country)
? "stripe"
: undefined
: undefined,
diff --git a/apps/web/ui/partners/connect-payout-button.tsx b/apps/web/ui/partners/connect-payout-button.tsx
index 644f09861e..9af3f278d3 100644
--- a/apps/web/ui/partners/connect-payout-button.tsx
+++ b/apps/web/ui/partners/connect-payout-button.tsx
@@ -75,7 +75,7 @@ export function ConnectPayoutButton(props: ButtonProps) {
: !payoutMethod
? `Your current country (${COUNTRIES[partner.country]}) is not supported for payout. Please update your country or contact support.`
: undefined,
- [partner?.country],
+ [partner, payoutMethod],
);
if (partner && !hasPermission(partner.role, "payout_settings.update")) {
@@ -94,7 +94,7 @@ export function ConnectPayoutButton(props: ButtonProps) {
<TooltipContent
title={errorMessage}
cta="Update profile settings"
- href="/settings"
+ href="/profile"
/>
)
}