From a73c7a41ef2d713668255ca88548e4f89f2e9bfa Mon Sep 17 00:00:00 2001 From: Aman Harwara Date: Tue, 21 Nov 2023 18:46:50 +0530 Subject: [PATCH] fix: Fixed issue with creating new tags and subtags --- .../Controllers/Navigation/NavigationController.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/web/src/javascripts/Controllers/Navigation/NavigationController.ts b/packages/web/src/javascripts/Controllers/Navigation/NavigationController.ts index d6cfeb632..a9678ebcc 100644 --- a/packages/web/src/javascripts/Controllers/Navigation/NavigationController.ts +++ b/packages/web/src/javascripts/Controllers/Navigation/NavigationController.ts @@ -601,11 +601,12 @@ export class NavigationController } public async save(tag: SNTag | SmartView, newTitle: string) { - const latestVersion = this.items.findSureItem(tag.uuid) + const isTemplateChange = this.items.isTemplateItem(tag) + + const latestVersion = isTemplateChange ? tag : this.items.findSureItem(tag.uuid) const hasEmptyTitle = newTitle.length === 0 const hasNotChangedTitle = newTitle === latestVersion.title - const isTemplateChange = this.items.isTemplateItem(latestVersion) const siblings = latestVersion instanceof SNTag ? tagSiblings(this.items, latestVersion) : [] const hasDuplicatedTitle = siblings.some((other) => other.title.toLowerCase() === newTitle.toLowerCase())