aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/utils.js2
-rw-r--r--routes/events.js6
-rw-r--r--routes/users.js4
3 files changed, 6 insertions, 6 deletions
diff --git a/lib/utils.js b/lib/utils.js
index 49f95a00..6a4bc1b2 100644
--- a/lib/utils.js
+++ b/lib/utils.js
@@ -65,7 +65,7 @@ export const getUser = async (username, transaction) => {
});
await wait(() => !store.fetching[pubkey], 100, 10);
- user.follows = JSON.parse(await redis.get(`${pubkey}:follows`));
+ user.follows = JSON.parse(await redis.get(`${pubkey}:follows`)) || [];
user.followers = await redis.sMembers(`${pubkey}:followers`);
}
diff --git a/routes/events.js b/routes/events.js
index a773cb1c..63189f70 100644
--- a/routes/events.js
+++ b/routes/events.js
@@ -1,7 +1,7 @@
import app from "$app";
import db from "$db";
import redis from "$lib/redis";
-import { pool } from "$lib/nostr";
+import { coinos } from "$lib/nostr";
import store from "$lib/store";
import { wait } from "$lib/utils";
@@ -27,7 +27,7 @@ app.get("/nostr/:pubkey", async (req, res) => {
let { since } = user;
- pool.subscribe(pubkey, {
+ coinos.subscribe(pubkey, {
since,
kinds: [1],
authors: [pubkey]
@@ -52,6 +52,6 @@ app.get("/nostr/:pubkey", async (req, res) => {
app.post("/nostr/send", async (req, res) => {
let { event } = req.body;
- pool.send(["EVENT", event]);
+ coinos.send(["EVENT", event]);
res.send(event);
});
diff --git a/routes/users.js b/routes/users.js
index 50d882ad..a276fd4e 100644
--- a/routes/users.js
+++ b/routes/users.js
@@ -64,7 +64,7 @@ app.get("/me", auth, async (req, res) => {
});
await wait(() => !store.fetching[pubkey], 100, 10);
- user.follows = JSON.parse(await redis.get(`${pubkey}:follows`));
+ user.follows = JSON.parse(await redis.get(`${pubkey}:follows`)) || [];
user.followers = await redis.sMembers(`${pubkey}:followers`);
}
@@ -117,7 +117,7 @@ app.get("/users/:username", async (req, res) => {
});
await wait(() => !store.fetching[pubkey], 100, 10);
- user.follows = JSON.parse(await redis.get(`${pubkey}:follows`));
+ user.follows = JSON.parse(await redis.get(`${pubkey}:follows`)) || [];
user.followers = await redis.sMembers(`${pubkey}:followers`);
}