datlechin / flarum-link-preview

MIT License
17 stars 5 forks source link

Fix: Display found preview image while not using the Google favicon API #16

Closed naxvog closed 1 year ago

naxvog commented 1 year ago

Sorry for the myriad of PRs but I found an issue failing to display the found image while not using the Google API. This PR fixes that issue and cleans up the JSX-code (quite rusty with those at the moment).

Feel free to merge/release this whenever as this fix is not a critical one :wink:

datlechin commented 1 year ago

The API response that have image property, should it shows default when useGoogleFavicon is diabled?

naxvog commented 1 year ago

Good catch. The LinkPreview-image Element should not be shown if there is no image and no Google Fallback available.

There is however the option to show a default image in such a case, but I prefer the element to not be shown instead as the less code for that is already in place.