readwiseio / obsidian-readwise

Official Readwise plugin for Obsidian
GNU General Public License v3.0
239 stars 23 forks source link

bugfix: ensure 'delete & reimport' works in reading view mode #61

Closed tyler-dot-earth closed 3 weeks ago

tyler-dot-earth commented 3 weeks ago

Makes the Delete and reimport command work when in "reading" mode (pictured below)

image

Seeing as how readwise exports should generally be treated as read-only, i recently started using another obsidian plugin to force the view mode of my readwise exports into the "reading" mode (that plugin calls it obsidianUIMode: preview) - which led me to discovering this quirk (:bug:) in the obsidian-readwise plugin: it only worked when in "editing" mode.

This PR fixes that by changing the callback to checkCallback which is triggered regardless of the view mode instead of the original editorCheckCallback which "is only triggered when the user is in an editor".

I have tested this change in a test vault - it works :heavy_check_mark:

Here's proof - notice the icon i've circled, which indicates that this is in the "reading" mode (it is a book icon when in editing mode) :arrow_heading_down: image

tadeoos commented 3 weeks ago

Great! Thanks a lot :)