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

fix: images url #419

Merged
merged 1 commit into from
Dec 6, 2023
Merged

fix: images url #419

merged 1 commit into from
Dec 6, 2023

Conversation

meelrossi
Copy link

Fix image src with new paths

Copy link

github-actions bot commented Dec 6, 2023

Pull Request Test Coverage Report for Build 7120086083

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 94.76%

Totals Coverage Status
Change from base Build 7116408601: 0.0%
Covered Lines: 13812
Relevant Lines: 14449

💛 - Coveralls

import env from "decentraland-gatsby/dist/utils/env"

export function getImageUrl(imageUrl?: string | null) {
if (env("NEW_ROLLOUT") && imageUrl && imageUrl.startsWith("/images")) {
Copy link
Collaborator

@braianj braianj Dec 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would ask if it doesn't start with http:// or https://

Suggested change
if (env("NEW_ROLLOUT") && imageUrl && imageUrl.startsWith("/images")) {
if (env("NEW_ROLLOUT") && imageUrl && !(imageUrl.startsWith("https://") || imageUrl.startsWith("http://"))) {

Copy link
Collaborator

@braianj braianj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏽

@meelrossi meelrossi merged commit 350a948 into master Dec 6, 2023
@meelrossi meelrossi deleted the fix/images-url branch December 6, 2023 21:06
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.

2 participants