mirror of
https://github.com/discourse/discourse.git
synced 2025-05-29 00:14:17 +08:00
FIX: Allow deletion of categories when chat channel is not present
Currently it’s not possible to delete a category if an associated chat channel is present even if there are no messages in this channel. This can lead to annoying situations for our users. This patch addresses the issue by checking if the channel is empty instead of just checking if there is a channel.
This commit is contained in:

committed by
Loïc Guitaut

parent
b9d4336a20
commit
9c482a645c
@ -177,6 +177,6 @@ module Chat::GuardianExtensions
|
||||
end
|
||||
|
||||
def can_delete_category?(category)
|
||||
super && !category.category_channel
|
||||
super && category.deletable_for_chat?
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user