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.

maintain backwards compatibility

Steven Tey6f946152b935
diff --git a/apps/web/app/(ee)/partners.dub.co/(dashboard)/messages/[programSlug]/page.tsx b/apps/web/app/(ee)/partners.dub.co/(dashboard)/messages/[programSlug]/page.tsx
index 1bcc935dc7..5dc143d00c 100644
--- a/apps/web/app/(ee)/partners.dub.co/(dashboard)/messages/[programSlug]/page.tsx
+++ b/apps/web/app/(ee)/partners.dub.co/(dashboard)/messages/[programSlug]/page.tsx
@@ -474,7 +474,7 @@ function ProgramInfoPanel({
</span>
<span className="text-content-subtle text-sm font-medium">
{isInactiveEnrollment
- ? `You are ${programEnrollment.status} from this program`
+ ? `You have been ${programEnrollment.status} from this program`
: `Partner since ${formatDate(programEnrollment.createdAt)}`}
</span>
</div>
diff --git a/apps/web/lib/messages/message-program.ts b/apps/web/lib/messages/message-program.ts
index 76df794353..a6f61aeee2 100644
--- a/apps/web/lib/messages/message-program.ts
+++ b/apps/web/lib/messages/message-program.ts
@@ -34,24 +34,23 @@ export const messageProgramAction = authPartnerActionClient
where: {
slug: programSlug,
- // partner is not banned, deactivated, or rejected
- partners: {
- some: {
- partnerId: partner.id,
- status: {
- notIn: INACTIVE_ENROLLMENT_STATUSES,
- },
- },
- },
-
OR: [
- // program has messaging enabled
{
+ // program has messaging enabled
messagingEnabledAt: {
not: null,
},
+ // partner is not banned, deactivated, or rejected
+ partners: {
+ some: {
+ partnerId: partner.id,
+ status: {
+ notIn: INACTIVE_ENROLLMENT_STATUSES,
+ },
+ },
+ },
},
- // partner has received a direct message from the program before (invited status)
+ // partner has received a direct message from the program before (e.g. reached out via the marketplace)
{
messages: {
some: {
diff --git a/apps/web/lib/messages/upload-partner-message-attachment.ts b/apps/web/lib/messages/upload-partner-message-attachment.ts
index d913572ceb..54f7d7c027 100644
--- a/apps/web/lib/messages/upload-partner-message-attachment.ts
+++ b/apps/web/lib/messages/upload-partner-message-attachment.ts
@@ -46,24 +46,23 @@ export const uploadPartnerMessageAttachmentAction = authPartnerActionClient
where: {
slug: programSlug,
- // partner is not banned, deactivated, or rejected
- partners: {
- some: {
- partnerId: partner.id,
- status: {
- notIn: INACTIVE_ENROLLMENT_STATUSES,
- },
- },
- },
-
OR: [
- // program has messaging enabled
{
+ // program has messaging enabled
messagingEnabledAt: {
not: null,
},
+ // partner is not banned, deactivated, or rejected
+ partners: {
+ some: {
+ partnerId: partner.id,
+ status: {
+ notIn: INACTIVE_ENROLLMENT_STATUSES,
+ },
+ },
+ },
},
- // partner has received a direct message from the program before (invited status)
+ // partner has received a direct message from the program before (e.g. reached out via the marketplace)
{
messages: {
some: {