fix(StatusTagSelector): forbid removing readonly tags

This commit is contained in:
Patryk Osmaczko 2022-08-30 10:11:28 +02:00 committed by Michał Cieślak
parent 20cbd99ae7
commit 40c90bb19f
1 changed files with 5 additions and 2 deletions

View File

@ -306,8 +306,11 @@ Item {
if ((event.key === Qt.Key_Backspace || event.key === Qt.Key_Escape) if ((event.key === Qt.Key_Backspace || event.key === Qt.Key_Escape)
&& getText(cursorPosition, (cursorPosition-1)) === "" && getText(cursorPosition, (cursorPosition-1)) === ""
&& (namesList.count-1) >= 0) { && (namesList.count-1) >= 0) {
removeMember(namesModel.get(namesList.count-1).pubKey); const item = namesModel.get(namesList.count-1)
namesModel.remove((namesList.count-1), 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)) { if ((event.key === Qt.Key_Return || event.key === Qt.Key_Enter) && (sortedList.count > 0)) {
root.insertTag(sortedList.get(userListView.currentIndex).name, root.insertTag(sortedList.get(userListView.currentIndex).name,