Socket
Socket
Sign inDemoInstall

gatsby-image

Package Overview
Dependencies
8
Maintainers
1
Versions
310
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.3 to 1.0.4

19

index.js

@@ -90,12 +90,25 @@ "use strict";

// If this browser doesn't support the IntersectionObserver API
// we just start downloading the image right away.
// we default to start downloading the image right away.
var _this = (0, _possibleConstructorReturn3.default)(this, _React$Component.call(this, props));
var isVisible = true;
var imgLoaded = true;
var IOSupported = false;
if (typeof window !== "undefined" && window.IntersectionObserver) {
isVisible = false;
imgLoaded = false;
IOSupported = true;
}
// Always don't render image while server rendering
if (typeof window === "undefined") {
isVisible = false;
imgLoaded = false;
}
_this.state = {
isVisible: isVisible
isVisible: isVisible,
imgLoaded: imgLoaded,
IOSupported: IOSupported
};

@@ -168,3 +181,3 @@

onLoad: function onLoad() {
return _this3.setState({ imgLoaded: true });
return _this3.state.IOSupported && _this3.setState({ imgLoaded: true });
}

@@ -171,0 +184,0 @@ })

2

package.json
{
"name": "gatsby-image",
"version": "1.0.3",
"version": "1.0.4",
"description": "Lazy-loading React image component with optional support for the blur-up effect.",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc