Parcourir la source

advancing federation

psy il y a 2 ans
Parent
commit
2f4ea518fc
2 fichiers modifiés avec 21 ajouts et 51 suppressions
  1. 2 50
      package-lock.json
  2. 19 1
      src/views/index.js

+ 2 - 50
package-lock.json

@@ -15657,8 +15657,7 @@
         },
         "ini": {
           "version": "1.3.5",
-          "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz",
-          "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw=="
+          "resolved": ""
         },
         "int53": {
           "version": "1.0.0",
@@ -17398,8 +17397,7 @@
         },
         "path-parse": {
           "version": "1.0.6",
-          "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz",
-          "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw=="
+          "resolved": ""
         },
         "path-type": {
           "version": "3.0.0",
@@ -19015,52 +19013,6 @@
             "ssb-client": "^4.9.0",
             "ssb-keys": "^7.2.2",
             "ssb-ref": "^2.14.0"
-          },
-          "dependencies": {
-            "abstract-leveldown": {
-              "version": "6.2.3",
-              "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.2.3.tgz",
-              "integrity": "sha512-BsLm5vFMRUrrLeCcRc+G0t2qOaTzpoJQLOubq2XM72eNpjF5UdU5o/5NvlNhx95XHcAvcl8OMXr4mlg/fRgUXQ==",
-              "requires": {
-                "buffer": "^5.5.0",
-                "immediate": "^3.2.3",
-                "level-concat-iterator": "~2.0.0",
-                "level-supports": "~1.0.0",
-                "xtend": "~4.0.0"
-              }
-            },
-            "level": {
-              "version": "6.0.1",
-              "resolved": "https://registry.npmjs.org/level/-/level-6.0.1.tgz",
-              "integrity": "sha512-psRSqJZCsC/irNhfHzrVZbmPYXDcEYhA5TVNwr+V92jF44rbf86hqGp8fiT702FyiArScYIlPSBTDUASCVNSpw==",
-              "requires": {
-                "level-js": "^5.0.0",
-                "level-packager": "^5.1.0",
-                "leveldown": "^5.4.0"
-              }
-            },
-            "level-js": {
-              "version": "5.0.2",
-              "resolved": "https://registry.npmjs.org/level-js/-/level-js-5.0.2.tgz",
-              "integrity": "sha512-SnBIDo2pdO5VXh02ZmtAyPP6/+6YTJg2ibLtl9C34pWvmtMEmRTWpra+qO/hifkUtBTOtfx6S9vLDjBsBK4gRg==",
-              "requires": {
-                "abstract-leveldown": "~6.2.3",
-                "buffer": "^5.5.0",
-                "inherits": "^2.0.3",
-                "ltgt": "^2.1.2"
-              }
-            },
-            "ssb-ref": {
-              "version": "2.16.0",
-              "resolved": "https://registry.npmjs.org/ssb-ref/-/ssb-ref-2.16.0.tgz",
-              "integrity": "sha512-ylyrfz9NLxwTCbeDDAdLo++O3elhNs6/gUqMhZ22F+gSOIjwXy2X7dpg5Q1YTH7uALOSu307Rpo1UfK9sj7Sjw==",
-              "requires": {
-                "ip": "^1.1.3",
-                "is-canonical-base64": "^1.1.1",
-                "is-valid-domain": "~0.0.1",
-                "multiserver-address": "^1.0.1"
-              }
-            }
           }
         },
         "ssb-keys": {

+ 19 - 1
src/views/index.js

@@ -1168,7 +1168,22 @@ exports.peersView = async ({ peers }) => {
 };
 
 exports.invitesView = ({ invites }) => {
-  const pubsList = (pub)
+  try{
+    var pubs = fs.readFileSync(offsetPath, "utf8");
+  }catch{
+      var pubs = undefined;
+  }
+  if (pubs == undefined) {
+        var pubsValue = "false";
+  }else{
+        var keys = Object.keys(pubs);
+        if (keys[0] === undefined){
+          var pubsValue = "false";
+        }else{
+          var pubsValue = "true";
+        }
+  }
+  if (pubsValue === "true") {
     var pubs = fs.readFileSync(offsetPath, "utf8");
     var pubs = JSON.parse(pubs);
     const arr2 = [];
@@ -1185,6 +1200,9 @@ exports.invitesView = ({ invites }) => {
       );
     }
     var pub = arr2;
+  }else{
+    var pub = [];
+  }
 
  return template(
   i18n.invites,