question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

All images are retrieved instead of one.

See original GitHub issue

Hi!

I am using your cool gallery and I am struggling with calls to server. Probably I am doing something wrong, but I cannot find it. Could you look at it?

I created my component and added simple code

function Gallery() {

    const [serverImages, setserverImages] = useState([]);

    const getLinks = () => {

        let x= window.innerHeight;
        console.log(x);
        console.log("get from endpoint");
        fetch(`https://localhost:5001/api/Images/List?height=`+x, {
            method: 'GET',
            headers: { 'Content-Type': 'application/json' }
        })
            .then(response => response.json())
            .then(result => setserverImages(result));
    }

    const handleClick=function(){
        debugger;
        getLinks();
    }

    return (
        <div>
            <button onClick={handleClick}>zrob</button>
            <ImageGallery items={serverImages} />
        </div>

    )
}

export default Gallery;

Unfortunatelly after each click on the button next, all images are received from server. So I have a gallery loaded. All small pictures below, one big picture in the middle of the screen.
Gallery1

My network is empty Gallery2

After clicking button next calls to all images is made. And all images are retrieved, each time I am clicking next button.

Gallery3

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ryanhughcommented, May 7, 2021

@pwujczyk Try unchecking the “Disable Cache” in your chrome dev tools and see if that fixes the issue.

see #583

0reactions
xiaolincommented, May 18, 2021

closing, feel free to reopen if you find issues.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Image retrieval - Wikipedia
An image retrieval system is a computer system used for browsing, searching and retrieving images from a large database of digital images.
Read more >
Image not retrieved (crawl rate too slow) or (crawl pending)
One or more of your products is disapproved and images are not displaying in Shopping ads or free listings. This could be due...
Read more >
Does storing a lot of images in a single directory slow down ...
The answer to that is "maybe". It's possible the file retrieval may be fine, but if you need ...
Read more >
If you're missing photos or videos in the Photos app
Tap a photo or video, then tap Recover. To recover multiple photos, tap Select, select your photos or videos, then tap Recover. Confirm...
Read more >
7 Reasons Why Images Are Not Loading on Your Website
1. Incorrect File Paths · 2. Files Names Misspelled · 3. Wrong File Extensions · 4. Missing Files · 5. The Website Hosting...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found