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

@veramo-community/veramo-react

Package Overview
Dependencies
Maintainers
1
Versions
75
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@veramo-community/veramo-react - npm Package Compare versions

Comparing version 0.3.0 to 0.3.1

22

lib/VeramoProvider.js

@@ -8,3 +8,3 @@ var __spreadArrays = (this && this.__spreadArrays) || function () {

};
import React, { useContext, useState, useEffect } from 'react';
import React, { useContext, useState } from 'react';
import { createAgentFromConfig, getStoredAgentConfigs, storeAgentConfigs, storeActiveAgentId, getStoredActiveAgentId, } from './utils';

@@ -27,11 +27,2 @@ import { v4 as uuidv4 } from 'uuid';

};
useEffect(function () {
var _a;
if (!activeAgentId && agents.length > 0) {
setActiveAgentId((_a = agents[0].context) === null || _a === void 0 ? void 0 : _a.id);
}
else if (agents.length === 0 && activeAgentId !== undefined) {
setActiveAgentId(undefined);
}
}, [agents, activeAgentId]);
var validateContext = function (context) {

@@ -44,2 +35,5 @@ if (!(context === null || context === void 0 ? void 0 : context.id))

setAgents(__spreadArrays(agents, [agent]));
if (!activeAgentId) {
setActiveAgentId(agent.context.id);
}
};

@@ -55,7 +49,9 @@ function addAgentConfig(config) {

var removeAgent = function (id) {
var _a, _b;
storeAgentConfigs(getStoredAgentConfigs().filter(function (c) { return c.context.id !== id; }));
var filtered = agents.filter(function (a) { var _a; return ((_a = a.context) === null || _a === void 0 ? void 0 : _a.id) !== id; });
setAgents(filtered);
if (activeAgentId === id) {
setActiveAgentId(undefined);
setActiveAgentId((_b = (_a = filtered[0]) === null || _a === void 0 ? void 0 : _a.context) === null || _b === void 0 ? void 0 : _b.id);
}
storeAgentConfigs(getStoredAgentConfigs().filter(function (c) { return c.context.id !== id; }));
setAgents(agents.filter(function (a) { var _a; return ((_a = a.context) === null || _a === void 0 ? void 0 : _a.id) !== id; }));
};

@@ -62,0 +58,0 @@ var getAgentConfig = function (id) {

{
"name": "@veramo-community/veramo-react",
"version": "0.3.0",
"version": "0.3.1",
"main": "./lib/index.js",

@@ -5,0 +5,0 @@ "types": "./lib/index.d.ts",

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