diff options
| author | Adam Soltys <[email protected]> | 2022-12-28 10:42:45 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2022-12-28 10:42:45 -0800 |
| commit | ddb9a4350c56889f5c639d8a689d054fd6791af2 (patch) | |
| tree | db1604e13a0d4847eaf919982c844339157037ef | |
| parent | 27778aeb6ff2dfd016588f15f97afa1632cd68cf (diff) | |
| parent | df3f91fbc6d0b75c4c875c787d8ab29b2f1d2768 (diff) | |
| download | coinos-server-ddb9a4350c56889f5c639d8a689d054fd6791af2.tar.gz coinos-server-ddb9a4350c56889f5c639d8a689d054fd6791af2.zip | |
Merge remote-tracking branch 'origin/prod'
| -rw-r--r-- | lib/utils.js | 2 | ||||
| -rw-r--r-- | routes/events.js | 6 | ||||
| -rw-r--r-- | routes/users.js | 4 |
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`); } |
