fix(CreateCategoryPopup): ensure channels are rendered in edit mode

Fixes #2984
This commit is contained in:
Pascal Precht 2021-07-21 12:28:56 +02:00 committed by Iuri Matias
parent bfab715465
commit 865b3385f3
1 changed files with 5 additions and 5 deletions

View File

@ -128,7 +128,7 @@ StatusModal {
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
width: parent.width - 32 width: parent.width - 32
visible: popup.isEdit ? visible: popup.isEdit ?
model.category === popup.categoryId || model.categoryId === "" : model.categoryId === popup.categoryId || model.categoryId === "" :
model.categoryId === "" model.categoryId === ""
title: "#" + model.name title: "#" + model.name
@ -139,16 +139,16 @@ StatusModal {
components: [ components: [
StatusCheckBox { StatusCheckBox {
id: channelItemCheckbox id: channelItemCheckbox
checked: popup.isEdit ? channels.indexOf(model.id) > - 1 : false checked: popup.isEdit ? popup.channels.indexOf(model.id) > - 1 : false
onCheckedChanged: { onCheckedChanged: {
var idx = channels.indexOf(model.id) var idx = popup.channels.indexOf(model.id)
if(checked){ if(checked){
if(idx === -1){ if(idx === -1){
channels.push(model.id) popup.channels.push(model.id)
} }
} else { } else {
if(idx > -1){ if(idx > -1){
channels.splice(idx, 1); popup.channels.splice(idx, 1);
} }
} }
} }