Skip to content

Commit 1288461

Browse files
committed
fix: do not add number to group if importing a group with the same uid
1 parent 2b11ee4 commit 1288461

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

app/src/main/java/io/github/sds100/keymapper/backup/BackupManager.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,8 @@ class BackupManagerImpl(
476476
modifiedGroup = RepositoryUtils.saveUniqueName(
477477
modifiedGroup,
478478
saveBlock = { renamedGroup ->
479-
if (siblings.any { sibling -> sibling.name == renamedGroup.name }) {
479+
// Do not rename the group with a (1) if it is the same UID. Just overwrite the name.
480+
if (siblings.any { sibling -> sibling.uid != renamedGroup.uid && sibling.name == renamedGroup.name }) {
480481
throw IllegalStateException("Non unique group name")
481482
}
482483
},

0 commit comments

Comments
 (0)