fix: make sure list subscriptions are set correctly when their namespace has a subscription already

This commit is contained in:
kolaente 2022-10-07 14:18:36 +02:00
parent bcb286a7f0
commit 2fc690a783
No known key found for this signature in database
GPG key ID: F40E70337AB24C9B

View file

@ -198,6 +198,11 @@ func makeNamespaceSlice(namespaces map[int64]*NamespaceWithLists, userMap map[in
n.Owner = userMap[n.OwnerID] n.Owner = userMap[n.OwnerID]
n.Subscription = subscriptions[n.ID] n.Subscription = subscriptions[n.ID]
all = append(all, n) all = append(all, n)
for _, l := range n.Lists {
if n.Subscription != nil && l.Subscription == nil {
l.Subscription = n.Subscription
}
}
} }
sort.Slice(all, func(i, j int) bool { sort.Slice(all, func(i, j int) bool {
return all[i].ID < all[j].ID return all[i].ID < all[j].ID