Fix topic deletion child topic count
This commit is contained in:
@@ -13,7 +13,13 @@ export const clearTopic = (topic: q.TreeNode<any>, recursive: boolean, subtopicC
|
|||||||
const topicCount = topic.childTopicCount()
|
const topicCount = topic.childTopicCount()
|
||||||
const deleteLimitMessage =
|
const deleteLimitMessage =
|
||||||
topicCount > subtopicClearLimit ? ` You can only delete ${subtopicClearLimit} child topics at once.` : ''
|
topicCount > subtopicClearLimit ? ` You can only delete ${subtopicClearLimit} child topics at once.` : ''
|
||||||
const childTopicsMessage = topicCount > 0 ? ` and ${topicCount} child ${topicCount === 1 ? 'topic' : 'topics'}` : ''
|
|
||||||
|
const topicDelta = topic.hasMessage() ? -1 : 0
|
||||||
|
const childTopicsMessage =
|
||||||
|
topicCount + topicDelta > 0
|
||||||
|
? ` and ${topicCount + topicDelta} child ${topicCount + topicDelta === 1 ? 'topic' : 'topics'}`
|
||||||
|
: ''
|
||||||
|
|
||||||
const confirmed = await dispatch(
|
const confirmed = await dispatch(
|
||||||
globalActions.requestConfirmation(
|
globalActions.requestConfirmation(
|
||||||
'Confirm delete',
|
'Confirm delete',
|
||||||
|
|||||||
Reference in New Issue
Block a user