Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

reddit-wallpapers

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

reddit-wallpapers - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

17

index.js

@@ -16,3 +16,3 @@ import {

loops: [],
index: parseInt(localStorage.redWallIndex) || 0,
index: parseInt(localStorage.redWallIndex) - 1 || 0,
previousChoice: undefined

@@ -42,8 +42,9 @@ }

new Promise((resolve, reject) => {
fetch(link).then((resp) => {
setTimeout(() => reject(
self.options.defaultImg === '' ? new Error('reddit request took too long, timed out') : setImage(true)
), self.options.timeout)
fetch(link)
.then((resp) => {
setTimeout(() => reject(false), self.options.timeout)
return resp.json()
}).then((json) => resolve(json)).catch((err) => self.options.defaultImg === '' ? console.warn(err) : setImage(true))
})
.then((json) => resolve(json))
.catch((err) => reject(false))
}).then((d) => {

@@ -59,2 +60,4 @@ self.data = d.data.children

function setImage(defaultImage=false) {
localStorage.redWallIndex = self.index + 1
self.index += 1
if (self.index >= self.data.length - 1 && !defaultImage) {

@@ -96,4 +99,2 @@ self.restart() // clearing loops and reinit

})
localStorage.redWallIndex = self.index + 1
self.index += 1
}

@@ -100,0 +101,0 @@ }

{
"name": "reddit-wallpapers",
"version": "0.0.3",
"version": "0.0.4",
"description": "to help fetching wallpapers with reddit api and loop setting them",

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

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc