shogun-button-react 1.5.15 → 1.5.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -34,7 +34,8 @@ export function ShogunButtonProvider({ children, sdk, options, onLoginSuccess, o
34
34
  if (!sdk)
35
35
  return;
36
36
  // Verifichiamo se l'utente è già loggato all'inizializzazione
37
- if (sdk.isLoggedIn()) {
37
+ // Aggiungiamo un controllo di sicurezza per verificare se il metodo esiste
38
+ if (sdk && typeof sdk.isLoggedIn === "function" && sdk.isLoggedIn()) {
38
39
  const pub = (_b = (_a = sdk.gun.user()) === null || _a === void 0 ? void 0 : _a.is) === null || _b === void 0 ? void 0 : _b.pub;
39
40
  if (pub) {
40
41
  setIsLoggedIn(true);
@@ -280,10 +281,14 @@ export function ShogunButtonProvider({ children, sdk, options, onLoginSuccess, o
280
281
  onLogout(); // AGGIUNTA
281
282
  };
282
283
  const hasPlugin = (name) => {
283
- return sdk ? sdk.hasPlugin(name) : false;
284
+ return sdk && typeof sdk.hasPlugin === "function"
285
+ ? sdk.hasPlugin(name)
286
+ : false;
284
287
  };
285
288
  const getPlugin = (name) => {
286
- return sdk ? sdk.getPlugin(name) : undefined;
289
+ return sdk && typeof sdk.getPlugin === "function"
290
+ ? sdk.getPlugin(name)
291
+ : undefined;
287
292
  };
288
293
  // Export Gun pair functionality
289
294
  const exportGunPair = async (password) => {
package/dist/connector.js CHANGED
@@ -1,10 +1,9 @@
1
1
  import ShogunCore from "shogun-core";
2
2
  export function shogunConnector(options) {
3
- const { peers = ["https://gun-manhattan.herokuapp.com/gun"], appName, logging, timeouts, oauth, ...restOptions } = options;
3
+ const { peers = ["https://gun-manhattan.herokuapp.com/gun"], appName, timeouts, oauth, ...restOptions } = options;
4
4
  const sdk = new ShogunCore({
5
5
  peers,
6
6
  scope: appName,
7
- logging,
8
7
  timeouts,
9
8
  oauth,
10
9
  });
@@ -14,10 +14,6 @@ export interface ShogunConnectorOptions {
14
14
  peers?: string[];
15
15
  authToken?: string;
16
16
  gunInstance?: IGunInstance<any>;
17
- logging?: {
18
- enabled: boolean;
19
- level: "error" | "warning" | "info" | "debug";
20
- };
21
17
  timeouts?: {
22
18
  login?: number;
23
19
  signup?: number;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "shogun-button-react",
3
3
  "description": "Shogun connector button",
4
- "version": "1.5.15",
4
+ "version": "1.5.17",
5
5
  "files": [
6
6
  "dist",
7
7
  "src/styles/index.css"
@@ -34,7 +34,7 @@
34
34
  "ethers": "^6.13.5",
35
35
  "prettier": "^3.5.3",
36
36
  "rxjs": "^7.8.1",
37
- "shogun-core": "^1.5.15"
37
+ "shogun-core": "^1.5.16"
38
38
  },
39
39
  "peerDependencies": {
40
40
  "react": "^18.0.0",