farling42 / obsidian-import-json

Plug-in for Obsidian.md which will create Notes from JSON files
MIT License
85 stars 5 forks source link

Allow import button to run multiple times #24

Closed jshank closed 1 year ago

jshank commented 2 years ago

While debugging my template file, I noticed that I needed to close out and reopen the import tool each time. I'd love it if I could just click Import again and have it run again.

jshank commented 2 years ago

Looks like it might be related to this error which occurs on subsequent imports without closing the plugin dialog:

plugin:obsidian-import-json:45 Uncaught (in promise) DOMException: The requested file could not be read, typically due to permission problems that have occurred after a reference to a file was acquired.

farling42 commented 2 years ago

If you change the contents of any of the files selected in the import window, then you will have to select the file again in the file selector - even though the window is displaying the correct filename.

By using the file selector again it will read the new version of the file. If the file selector is not used to select the "same" file again, then it will try and open the old version of the file (which does not exist).

This is a limitation of the way that the security works in web browsers.

jshank commented 1 year ago

Understood. If I open the template selection again, cancel the dialog, then open it once more and re-select the modified template, I am able to run the import again. Thanks!