From f1d7bdb0693c599b1e5dd1abdfe44e0d537b2759 Mon Sep 17 00:00:00 2001 From: Patryk Osmaczko Date: Tue, 30 Aug 2022 10:11:28 +0200 Subject: [PATCH] fix(StatusTagSelector): forbid removing readonly tags --- src/StatusQ/Components/StatusTagSelector.qml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/StatusQ/Components/StatusTagSelector.qml b/src/StatusQ/Components/StatusTagSelector.qml index f7dc20c8..abb20d6b 100644 --- a/src/StatusQ/Components/StatusTagSelector.qml +++ b/src/StatusQ/Components/StatusTagSelector.qml @@ -306,8 +306,11 @@ Item { if ((event.key === Qt.Key_Backspace || event.key === Qt.Key_Escape) && getText(cursorPosition, (cursorPosition-1)) === "" && (namesList.count-1) >= 0) { - removeMember(namesModel.get(namesList.count-1).pubKey); - namesModel.remove((namesList.count-1), 1); + const item = namesModel.get(namesList.count-1) + if (!item.isReadonly) { + removeMember(item.pubKey); + namesModel.remove((namesList.count-1), 1); + } } if ((event.key === Qt.Key_Return || event.key === Qt.Key_Enter) && (sortedList.count > 0)) { root.insertTag(sortedList.get(userListView.currentIndex).name,