Add relay
@@ -115,21 +104,17 @@
Nostrclient Extension
This extension is a always-on nostr client that other extensions can
- use to send and receive events on nostr. Add multiple nostr relays to
- connect to. The extension then opens a websocket for you to use at
-
+ use to send and receive events on nostr.
-
-
-
+ Add multiple nostr relays to connect to. The extension then opens a websocket for you to use
+ at
+
+
+
+
+ Only Admin users can manage
+ this extension.
- Only Admin users can manage this extension.
-
@@ -232,7 +217,7 @@
message: `Invalid relay URL.`,
caption: "Should start with 'wss://'' or 'ws://'"
})
- return false
+ return false;
}
console.log('ADD RELAY ' + this.relayToAdd)
let that = this
@@ -244,7 +229,7 @@
{url: this.relayToAdd}
)
.then(function (response) {
- console.log('response:', response)
+ console.log("response:", response)
if (response.data) {
response.data.map(maplrelays)
that.nostrrelayLinks = response.data
@@ -254,7 +239,7 @@
.catch(function (error) {
LNbits.utils.notifyApiError(error)
})
- return false
+ return false;
},
deleteRelay(url) {
console.log('DELETE RELAY ' + url)
diff --git a/views.py b/views.py
index a05f956..ce30b3b 100644
--- a/views.py
+++ b/views.py
@@ -6,12 +6,11 @@ from fastapi import Request
from fastapi.param_functions import Query
from fastapi.params import Depends
from fastapi.templating import Jinja2Templates
-from starlette.responses import HTMLResponse
-
from lnbits.core.crud import update_payment_status
from lnbits.core.models import User
from lnbits.core.views.api import api_payment
from lnbits.decorators import check_admin, check_user_exists
+from starlette.responses import HTMLResponse
from . import nostr_renderer, nostrclient_ext
diff --git a/views_api.py b/views_api.py
index 15cc3ab..c3da200 100644
--- a/views_api.py
+++ b/views_api.py
@@ -3,11 +3,10 @@ from http import HTTPStatus
from typing import Optional
from fastapi import Depends, WebSocket
-from loguru import logger
-from starlette.exceptions import HTTPException
-
from lnbits.decorators import check_admin
from lnbits.helpers import urlsafe_short_hash
+from loguru import logger
+from starlette.exceptions import HTTPException
from . import nostrclient_ext
from .crud import add_relay, delete_relay, get_relays