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.
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.
https://user-images.githubusercontent.com/64155612/120356847-a18c5900-c2b9-11eb-9d2a-447d48836375.mp4
Originally posted by @GitMurf in https://github.com/shabegom/obsidian-reference-count/issues/26#issuecomment-852252659