Closed GitMurf closed 3 years ago
I was able to remove them via the console with this:
Here is code we could use to add to the onunload function of the plugin to make sure to cleanup any remaining search views/panes:
async onunload() {
this.app.workspace
.getLeavesOfType('search-ref')
.forEach((leaf: WorkspaceLeaf) => leaf.detach());
}
@shabegom thoughts on this? Do you see any issue with adding this into the onunload() function?
Ok looks like I figured out why/how they got in the sidebar. It looks like it adds them each time you click a block ref counter button? We should definitely implement the onunload() fix above but also should try and figure out how not to add to the sidebar? Or at least hide from the sidebar?
Also maybe we run the same cleanup on obsidian start. So each time we start we start fresh without any old search views. If you click a block ref counter button and don't close the search view and then close Obsidian, when you open it next time you will have a search view in the sidebar that you can't remove.
Opened up #29 for the second part of the problem which is not letting the Search view be added to the right sidebar or at least hide it from the user.
Now sure how or when they snuck in, but something to keep an eye out. It may have been one of the earlier versions we were testing. But you cannot right click them to remove. So either have to revert back to a different workspace to remove them or programmatically remove them from the console.