From 1ef2031fae6a93d0f024e52a6bc1838c7b6a8c8a Mon Sep 17 00:00:00 2001 From: Krzysztof Kotlarek Date: Tue, 24 Jan 2023 11:28:04 +1100 Subject: [PATCH] FIX: TL4 user is not redirected to latest when delete topic (#19967) Continue of https://github.com/discourse/discourse/pull/19766 When TL4 is allowed to delete topic, they should not be redirected to / after that action. --- app/assets/javascripts/discourse/app/models/topic.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/assets/javascripts/discourse/app/models/topic.js b/app/assets/javascripts/discourse/app/models/topic.js index f4729483375..4667825058c 100644 --- a/app/assets/javascripts/discourse/app/models/topic.js +++ b/app/assets/javascripts/discourse/app/models/topic.js @@ -471,6 +471,10 @@ const Topic = RestModel.extend({ !deleted_by.staff && !deleted_by.groups.some( (group) => group.name === this.category.reviewable_by_group_name + ) && + !( + this.siteSettings.tl4_delete_posts_and_topics && + deleted_by.trust_level >= 4 ) ) { DiscourseURL.redirectTo("/");