fix(Communities): make create community categories modal work again

Fixes: #3391
This commit is contained in:
Pascal Precht 2021-09-07 15:39:10 +02:00 committed by RichΛrd
parent 52b302aa55
commit 34707b7298
1 changed files with 7 additions and 7 deletions

View File

@ -27,15 +27,15 @@ StatusModal {
onOpened: { onOpened: {
if(isEdit){ if(isEdit){
popup.contentComponent.categoryName.input.text = categoryName popup.contentItem.categoryName.input.text = categoryName
channels = JSON.parse(chatsModel.communities.activeCommunity.getChatIdsByCategory(categoryId)) channels = JSON.parse(chatsModel.communities.activeCommunity.getChatIdsByCategory(categoryId))
} }
popup.contentComponent.categoryName.input.forceActiveFocus(Qt.MouseFocusReason) popup.contentItem.categoryName.input.forceActiveFocus(Qt.MouseFocusReason)
} }
onClosed: destroy() onClosed: destroy()
function isFormValid() { function isFormValid() {
return contentComponent.categoryName.valid return contentItem.categoryName.valid
} }
header.title: isEdit ? header.title: isEdit ?
@ -161,9 +161,9 @@ StatusModal {
sensor.onClicked: { sensor.onClicked: {
openPopup(deleteCategoryConfirmationDialogComponent, { openPopup(deleteCategoryConfirmationDialogComponent, {
//% "Delete %1 category" //% "Delete %1 category"
title: qsTrId("delete--1-category").arg(popup.contentComponent.categoryName.input.text), title: qsTrId("delete--1-category").arg(popup.contentItem.categoryName.input.text),
//% "Are you sure you want to delete %1 category? Channels inside the category wont be deleted." //% "Are you sure you want to delete %1 category? Channels inside the category wont be deleted."
confirmationText: qsTrId("are-you-sure-you-want-to-delete--1-category--channels-inside-the-category-won-t-be-deleted-").arg(popup.contentComponent.categoryName.input.text) confirmationText: qsTrId("are-you-sure-you-want-to-delete--1-category--channels-inside-the-category-won-t-be-deleted-").arg(popup.contentItem.categoryName.input.text)
}) })
} }
@ -216,9 +216,9 @@ StatusModal {
let error = "" let error = ""
if (isEdit) { if (isEdit) {
error = chatsModel.communities.editCommunityCategory(communityId, categoryId, Utils.filterXSS(popup.contentComponent.categoryName.input.text), JSON.stringify(channels)) error = chatsModel.communities.editCommunityCategory(communityId, categoryId, Utils.filterXSS(popup.contentItem.categoryName.input.text), JSON.stringify(channels))
} else { } else {
error = chatsModel.communities.createCommunityCategory(communityId, Utils.filterXSS(popup.contentComponent.categoryName.input.text), JSON.stringify(channels)) error = chatsModel.communities.createCommunityCategory(communityId, Utils.filterXSS(popup.contentItem.categoryName.input.text), JSON.stringify(channels))
} }
if (error) { if (error) {