Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(ui): improve icon fetching. WF-141 #709

Open
wants to merge 7 commits into
base: dev
Choose a base branch
from

Conversation

madeindjs
Copy link
Collaborator

@madeindjs madeindjs commented Dec 23, 2024

Introduce a new component ShareImgWithFallback which takes an array of URLs for the image and uses the first successful URL.

This component uses a new hook useAssetContentType that takes care of fetching the Content-Type header of the asset URL, and handles the concurrency / cache. The Content-Type is needed because the server might serve a default text/html if the assets doesn't exist.

It also fix an edge case wherein the application run is an URL path like https://streamsync-dev.osc-fr1.scalingo.io/hello/, we are trying to import asset from the root (https://streamsync-dev.osc-fr1.scalingo.io/) and not the path /hello

I also took the opportunity to test the Vue.js component using Vue Test Utils

This change is transparent for the user.

@madeindjs madeindjs self-assigned this Dec 23, 2024
@madeindjs madeindjs marked this pull request as ready for review December 23, 2024 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant