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

Need to reload page after uploading image to show the thumbnail #993

Closed
Quicksaver opened this issue Jan 8, 2018 · 3 comments · Fixed by #994
Closed

Need to reload page after uploading image to show the thumbnail #993

Quicksaver opened this issue Jan 8, 2018 · 3 comments · Fixed by #994

Comments

@Quicksaver
Copy link
Contributor

- Do you want to request a feature or report a bug?
bug

- What is the current behavior?
When working on a private repo, new image uploads don't show the thumbnail until you reload the page, leading the user sometimes to think the upload failed because they see a broken thumbnail icon. Apparently the src url of new images don't have the token query parameter that is applied when the page loads, a page reload makes the thumbnail appear as expected.
screen shot 2018-01-08 at 14 39 03

- If the current behavior is a bug, please provide the steps to reproduce.

  • Open media library
  • Upload new image
  • Wait for image to be uploaded so that its item shows before the others

- What is the expected behavior?
I'd expect the thumbnail to be visible immediately after upload is finished.

- Please mention your CMS, node.js, and operating system version.

Netlify CMS 1.0.3, also tried with latest master running on Node 8.9.3 (lts/carbon).

- Please link or paste your config.yml below if applicable.

backend:
  name: github
  ...
media_folder: "/static/images/uploads"
public_folder: "/images/uploads"
@tech4him1
Copy link
Contributor

This is related to #990.

@erquhart
Copy link
Contributor

Ah, this is because we're constructing the url after the initial upload: https://github.com/netlify/netlify-cms/blob/master/src/backends/github/implementation.js#L139

We'll need to find the best way to get the token, or just fetch the file after upload.

@tech4him1
Copy link
Contributor

I guess we could still construct the URL, then add the token as a query parameter if it's a private repo. That's not necessarily the most maintainable way, though, vs fetching the URL from GitHub or pulling the media through the API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants