Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix issue where child tags would get hidden in exclusive vault mode if parent tag is in different vault #2502

Merged
merged 1 commit into from Sep 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/services/src/Domain/Item/ItemManagerInterface.ts
Expand Up @@ -117,6 +117,7 @@ export interface ItemManagerInterface extends AbstractService {
getDisplayableTags(): SNTag[]
getTagChildren(itemToLookupUuidFor: SNTag): SNTag[]
getTagParent(itemToLookupUuidFor: SNTag): SNTag | undefined
getDisplayableTagParent(itemToLookupUuidFor: SNTag): SNTag | undefined
isValidTagParent(parentTagToLookUpUuidFor: SNTag, childToLookUpUuidFor: SNTag): boolean
isSmartViewTitle(title: string): boolean
getDisplayableComponents(): ComponentInterface[]
Expand Down
12 changes: 12 additions & 0 deletions packages/snjs/lib/Services/Items/ItemManager.ts
Expand Up @@ -640,6 +640,18 @@ export class ItemManager extends Services.AbstractService implements Services.It
return undefined
}

getDisplayableTagParent(itemToLookupUuidFor: Models.SNTag): Models.SNTag | undefined {
const tag = this.findItem<Models.SNTag>(itemToLookupUuidFor.uuid)
if (!tag) {
return undefined
}
const parentId = tag.parentId
if (parentId) {
return this.tagDisplayController.items().find((displayableTag) => displayableTag.uuid === parentId)
}
return undefined
}

public getTagPrefixTitle(tag: Models.SNTag): string | undefined {
const hierarchy = this.getTagParentChain(tag)

Expand Down
Expand Up @@ -472,7 +472,7 @@ export class NavigationController
}

get rootTags(): SNTag[] {
return this.tags.filter((tag) => !this.items.getTagParent(tag))
return this.tags.filter((tag) => !this.items.getDisplayableTagParent(tag))
}

get tagsCount(): number {
Expand Down