Merge branch 'bunker' into 'main'
NConnect -> NBunker See merge request soapbox-pub/soapbox!3183
This commit is contained in:
commit
0a6532f34a
|
@ -1,7 +1,7 @@
|
||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
|
|
||||||
import { useNostr } from 'soapbox/contexts/nostr-context';
|
import { useNostr } from 'soapbox/contexts/nostr-context';
|
||||||
import { NConnect } from 'soapbox/features/nostr/NConnect';
|
import { NBunker } from 'soapbox/features/nostr/NBunker';
|
||||||
|
|
||||||
const secretStorageKey = 'soapbox:nip46:secret';
|
const secretStorageKey = 'soapbox:nip46:secret';
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ function useSignerStream() {
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!relay || !signer || !pubkey) return;
|
if (!relay || !signer || !pubkey) return;
|
||||||
|
|
||||||
const connect = new NConnect({
|
const bunker = new NBunker({
|
||||||
relay,
|
relay,
|
||||||
signer,
|
signer,
|
||||||
onAuthorize(authorizedPubkey) {
|
onAuthorize(authorizedPubkey) {
|
||||||
|
@ -51,7 +51,7 @@ function useSignerStream() {
|
||||||
});
|
});
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
connect.close();
|
bunker.close();
|
||||||
};
|
};
|
||||||
}, [relay, signer, pubkey]);
|
}, [relay, signer, pubkey]);
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { NRelay, NostrConnectRequest, NostrConnectResponse, NostrEvent, NostrSigner, NSchema as n } from '@nostrify/nostrify';
|
import { NRelay, NostrConnectRequest, NostrConnectResponse, NostrEvent, NostrSigner, NSchema as n } from '@nostrify/nostrify';
|
||||||
|
|
||||||
interface NConnectOpts {
|
interface NBunkerOpts {
|
||||||
relay: NRelay;
|
relay: NRelay;
|
||||||
signer: NostrSigner;
|
signer: NostrSigner;
|
||||||
authorizedPubkey: string | undefined;
|
authorizedPubkey: string | undefined;
|
||||||
|
@ -9,7 +9,7 @@ interface NConnectOpts {
|
||||||
getSecret(): string;
|
getSecret(): string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class NConnect {
|
export class NBunker {
|
||||||
|
|
||||||
private relay: NRelay;
|
private relay: NRelay;
|
||||||
private signer: NostrSigner;
|
private signer: NostrSigner;
|
||||||
|
@ -20,7 +20,7 @@ export class NConnect {
|
||||||
|
|
||||||
private controller = new AbortController();
|
private controller = new AbortController();
|
||||||
|
|
||||||
constructor(opts: NConnectOpts) {
|
constructor(opts: NBunkerOpts) {
|
||||||
this.relay = opts.relay;
|
this.relay = opts.relay;
|
||||||
this.signer = opts.signer;
|
this.signer = opts.signer;
|
||||||
this.authorizedPubkey = opts.authorizedPubkey;
|
this.authorizedPubkey = opts.authorizedPubkey;
|
Loading…
Reference in New Issue