-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix subscriptions #2261
Fix subscriptions #2261
Conversation
</Col> | ||
<Col flex="2"> | ||
<p> | ||
If this user is currently subscribed through a distribution list, you will need to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a warning as the code will take a lot longer to write.
@@ -192,3 +178,39 @@ export const MyProducts: React.FC = () => { | |||
</styled.MyProducts> | |||
); | |||
}; | |||
|
|||
const modalBody = (active: ISelectedProduct) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed text based on status. This all got messy due to distribution lists.
this.IsSubscribed = subscription?.IsSubscribed ?? false; | ||
} | ||
else if (entity.Product.ProductType == Entities.ProductType.EveningOverview) | ||
{ | ||
var subscription = entity.User.AVOverviewSubscriptionsManyToMany | ||
.FirstOrDefault(s => s.UserId == entity.UserId && | ||
(int)s.TemplateType == entity.Product!.TargetProductId); | ||
.FirstOrDefault(s => s.IsSubscribed && (int)s.TemplateType == entity.Product!.TargetProductId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't love this, but since a user can be subscribed through a distribution list it's currently necessary.
@@ -109,15 +110,13 @@ public UserProductModel(Entities.UserProduct entity) : base(entity) | |||
else if (entity.Product.ProductType == Entities.ProductType.Notification) | |||
{ | |||
var subscription = entity.User.NotificationSubscriptionsManyToMany | |||
.FirstOrDefault(s => s.UserId == entity.UserId && | |||
s.NotificationId == entity.Product!.TargetProductId); | |||
.FirstOrDefault(s => s.IsSubscribed && s.NotificationId == entity.Product!.TargetProductId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't love this, but since a user can be subscribed through a distribution list it's currently necessary.
Fixing various issues related to subscriptions through a distribution list.