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

wappsto-blanket

Package Overview
Dependencies
Maintainers
1
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wappsto-blanket - npm Package Compare versions

Comparing version 0.0.21 to 0.0.22

22

hooks/useLogs.js

@@ -1,2 +0,2 @@

import { useState, useRef, useCallback } from 'react';
import { useState, useRef, useCallback, useEffect } from 'react';
import { getSession } from 'wappsto-redux/selectors/session';

@@ -25,2 +25,3 @@ import { useSelector } from 'react-redux';

const cancelFunc = useRef();
const unmounted = useRef(false);

@@ -51,6 +52,8 @@ const setCurrentStatus = (status) => {

let more = true;
let offset = 0;
try{
while(more && !isCanceled.current){
const url = `${getServiceUrl('log')}/${stateId}?start=${start}&end=${end}&offset=${offset}&type=state&limit=3600`;
if(cachedData.current.length > 0){
start = cachedData.current[cachedData.current.length - 1].time;
}
const url = `${getServiceUrl('log')}/${stateId}?start=${start}&end=${end}&type=state&limit=3600`;
const result = await axios.get(url, {

@@ -66,5 +69,7 @@ headers: { "x-session": sessionId || activeSession.meta.id },

cachedData.current = cachedData.current.concat(result.data.data);
offset = cachedData.current.length;
more = result.data.more;
}
if(unmounted.current){
return;
}
if(!isCanceled.current){

@@ -75,2 +80,5 @@ setData(cachedData.current);

} catch(e){
if(unmounted.current){
return;
}
if(!isCanceled.current){

@@ -85,2 +93,8 @@ setData(cachedData.current);

useEffect(() => {
return () => {
unmounted.current = true;
}
}, []);
const cancel = useCallback(() => {

@@ -87,0 +101,0 @@ if(cancelFunc.current){

@@ -1,2 +0,2 @@

import { useState, useRef, useCallback, useMemo } from 'react';
import { useState, useRef, useCallback, useMemo, useEffect } from 'react';
import { useSelector, useDispatch } from 'react-redux';

@@ -31,2 +31,3 @@ import { setItem } from 'wappsto-redux/actions/items';

const isCanceled = useRef(false);
const unmounted = useRef(false);

@@ -74,2 +75,5 @@ const setCurrentStatus = (status) => {

);
if(unmounted.current){
return;
}
if(result.status !== 200){

@@ -84,2 +88,5 @@ throw new Error("error");

} catch(e){
if(unmounted.current){
return;
}
setCurrentStatus(STATUS.ERROR);

@@ -90,2 +97,8 @@ }

useEffect(() => {
return () => {
unmounted.current = true;
}
}, []);
const cancel = useCallback(() => {

@@ -92,0 +105,0 @@ if(cancelFunc.current){

2

package.json
{
"name": "wappsto-blanket",
"version": "0.0.21",
"version": "0.0.22",
"description": "",

@@ -5,0 +5,0 @@ "scripts": {

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