Fivefold / linkding-injector

Injects search results from the linkding bookmark service into search pages like google and duckduckgo
MIT License
194 stars 7 forks source link

Fix Signature Error and Refactor saveConfiguration #20

Closed Sevichecc closed 1 year ago

Sevichecc commented 1 year ago

There is a signature error in the getConfiguration method:

image
Uncaught (in promise) TypeError: Error in invocation of storage.get(optional [string|array|object] keys, function callback): No matching signature.
    at getConfiguration (configuration.js:8:32)
    at isConfigurationComplete (linkding.js:4:4)
    at background.js:33:10

And this PR aims to fix it and refactor the saveConfiguration method to be cleaner.

Sevichecc commented 1 year ago

The code has been refactored based on the review. Any suggestion?

Sevichecc commented 1 year ago

Huh, interesting. I never got this error and can't reproduce it (on Windows 10). Maybe another OS-specific thing? Your changed code works just as well on Windows though (i.e. triggers no errors and can successfully fetch the configuration)

Pending the changes I'm happy to merge this.

The error is a bit weird, and I have spent some time figuring it out. It might be an OS-specific issue, or it might not be. Probably something is wrong with my local environment.

Fivefold commented 1 year ago

The code has been refactored based on the review. Any suggestion?

Sorry, I wasn't clear enough with "outside the function" in https://github.com/Fivefold/linkding-injector/pull/20#discussion_r1216489587

I added the change I intended myself, no worries.

The error is a bit weird, and I have spent some time figuring it out. It might be an OS-specific issue, or it might not be. Probably something is wrong with my local environment.

Maybe, but if this fixes it, it doesn't matter in the end.


Thanks again for your time and work, I appreciate it!