Skip to content

Commit

Permalink
fix: error when trying to create new note inside a tag/folder
Browse files Browse the repository at this point in the history
  • Loading branch information
amanharwara committed Oct 13, 2022
1 parent 721c9e7 commit 4a59216
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/snjs/lib/Services/Items/ItemManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1440,12 +1440,12 @@ export class ItemManager
itemOne: Models.DecryptedItemInterface<Models.ItemContent>,
itemTwo: Models.DecryptedItemInterface<Models.ItemContent>,
): 'direct' | 'indirect' | 'unlinked' {
const itemOneReferencesItemTwo = !!this.referencesForItem(itemOne).find(
(reference) => reference.uuid === itemTwo.uuid,
)
const itemTwoReferencesItemOne = !!this.referencesForItem(itemTwo).find(
(reference) => reference.uuid === itemOne.uuid,
)
const itemOneReferencesItemTwo = this.isTemplateItem(itemOne)
? false
: !!this.referencesForItem(itemOne).find((reference) => reference.uuid === itemTwo.uuid)
const itemTwoReferencesItemOne = this.isTemplateItem(itemTwo)
? false
: !!this.referencesForItem(itemTwo).find((reference) => reference.uuid === itemOne.uuid)

return itemOneReferencesItemTwo ? 'direct' : itemTwoReferencesItemOne ? 'indirect' : 'unlinked'
}
Expand Down

0 comments on commit 4a59216

Please sign in to comment.