chore: when creating new tag from link input, move it to the vault the item is in before linking
This commit is contained in:
@@ -302,7 +302,17 @@ export class LinkingController extends AbstractViewController implements Interna
|
|||||||
|
|
||||||
const activeItem = this.activeItem
|
const activeItem = this.activeItem
|
||||||
if (activeItem) {
|
if (activeItem) {
|
||||||
await this.addTagToItem(newTag, activeItem)
|
const itemVault = this.vaults.getItemVault(activeItem)
|
||||||
|
|
||||||
|
if (itemVault) {
|
||||||
|
const movedTag = await this.vaults.moveItemToVault(itemVault, newTag)
|
||||||
|
if (!movedTag) {
|
||||||
|
throw new Error('Failed to move tag to item vault')
|
||||||
|
}
|
||||||
|
await this.addTagToItem(movedTag as SNTag, activeItem)
|
||||||
|
} else {
|
||||||
|
await this.addTagToItem(newTag, activeItem)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return newTag
|
return newTag
|
||||||
|
|||||||
Reference in New Issue
Block a user