From 3e11c9e4aa3618e58af413c98d6992ae18d444f7 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Wed, 7 Sep 2022 13:29:30 -0700 Subject: prettier --- index.js | 2 +- lib/sockets.js | 3 --- routes/lnurl.js | 13 ++++++++----- routes/referrals.js | 10 ++++------ sampleconfig/index.js | 1 - 5 files changed, 13 insertions(+), 16 deletions(-) diff --git a/index.js b/index.js index 06734322..8262967d 100644 --- a/index.js +++ b/index.js @@ -23,7 +23,7 @@ import "./routes/payments"; if (config.bitcoin) store.networks.push("bitcoin"); if (config.liquid) store.networks.push("liquid"); if (config.lna) store.networks.push("lightning"); -// if (config.lnurl) import("./routes/lnurl"); +if (config.lnurl) import("./routes/lnurl"); let host = process.env.HOST || "0.0.0.0"; let port = process.env.PORT || 3119; diff --git a/lib/sockets.js b/lib/sockets.js index 252ee552..9ff454aa 100644 --- a/lib/sockets.js +++ b/lib/sockets.js @@ -15,7 +15,6 @@ const code = 1000; const wss = new WebSocket.Server({ clientTracking: false, noServer: true }); -/* eslint-disable-next-line */ const pick = (O, ...K) => K.reduce((o, k) => ((o[k] = O[k]), o), {}); const all = {}; const subscriptions = []; @@ -34,7 +33,6 @@ export const emit = (username, type, data) => { (data.address && s.invoice.unconfidential === data.address) ) { s.ws.send(JSON.stringify({ type, data })); - // subscriptions.splice(i, 1); } } } @@ -87,7 +85,6 @@ app.register(async function(app) { case "login": let token = data; - // if (differenceInSeconds(new Date(), lastSeen[token]) < 5) return; lastSeen[token] = new Date(); try { diff --git a/routes/lnurl.js b/routes/lnurl.js index 1cf5e319..54b82ade 100644 --- a/routes/lnurl.js +++ b/routes/lnurl.js @@ -1,16 +1,19 @@ -import { emit } from "$lib/sockets"; -import store from "$lib/store"; import app from "$app"; import config from "$config"; +import store from "$lib/store"; +import { optionalAuth, auth } from "$lib/passport"; + +import lnd from "$lib/lnd"; +import persist from "$lib/persist"; +import { emit } from "$lib/sockets"; + import axios from "axios"; import lnurl from "lnurl"; import jwt from "jsonwebtoken"; import qs from "query-string"; -import persist from "$lib/persist"; import bolt11 from "bolt11"; -import { optionalAuth, auth } from "$lib/passport"; + import { createInvoice, getPayments } from "lightning"; -import lnd from "$lib/lnd"; export const logins = persist("data/logins.json"); export const recipients = persist("data/recipients.json"); diff --git a/routes/referrals.js b/routes/referrals.js index b3d53306..7193964d 100644 --- a/routes/referrals.js +++ b/routes/referrals.js @@ -180,12 +180,10 @@ router.get("/verify/:user_id/:token", auth, async (req, res) => { updated: found.updated_at }); } else { - res - .code(500) - .send({ - verified: false, - message: "Referral already " + found[0].status - }); + res.code(500).send({ + verified: false, + message: "Referral already " + found[0].status + }); } } else { res.code(500).send("Invalid referral token"); diff --git a/sampleconfig/index.js b/sampleconfig/index.js index b39eab5a..0896d541 100644 --- a/sampleconfig/index.js +++ b/sampleconfig/index.js @@ -1,4 +1,3 @@ - const db = { user: "root", password: "password", -- cgit v1.2.3