kopia lustrzana https://gitlab.com/soapbox-pub/soapbox
Remove signer from NostrContext
rodzic
46687a0a02
commit
0c4851f4cf
|
@ -1,12 +1,10 @@
|
|||
import { NRelay1, NostrSigner } from '@nostrify/nostrify';
|
||||
import { NRelay1 } from '@nostrify/nostrify';
|
||||
import React, { createContext, useContext, useState, useEffect } from 'react';
|
||||
|
||||
import { useSigner } from 'soapbox/hooks/nostr/useSigner';
|
||||
import { useInstance } from 'soapbox/hooks/useInstance';
|
||||
|
||||
interface NostrContextType {
|
||||
relay?: NRelay1;
|
||||
signer?: NostrSigner;
|
||||
isRelayLoading: boolean;
|
||||
}
|
||||
|
||||
|
@ -18,7 +16,6 @@ interface NostrProviderProps {
|
|||
|
||||
export const NostrProvider: React.FC<NostrProviderProps> = ({ children }) => {
|
||||
const { instance } = useInstance();
|
||||
const { signer } = useSigner();
|
||||
|
||||
const [relay, setRelay] = useState<NRelay1>();
|
||||
const [isRelayLoading, setIsRelayLoading] = useState(true);
|
||||
|
@ -44,7 +41,7 @@ export const NostrProvider: React.FC<NostrProviderProps> = ({ children }) => {
|
|||
}, [relayUrl]);
|
||||
|
||||
return (
|
||||
<NostrContext.Provider value={{ relay, signer, isRelayLoading }}>
|
||||
<NostrContext.Provider value={{ relay, isRelayLoading }}>
|
||||
{children}
|
||||
</NostrContext.Provider>
|
||||
);
|
||||
|
|
|
@ -5,6 +5,7 @@ import { Button, Column, Form, FormActions, Stack } from 'soapbox/components/ui'
|
|||
import { useNostr } from 'soapbox/contexts/nostr-context';
|
||||
import { useNostrReq } from 'soapbox/features/nostr/hooks/useNostrReq';
|
||||
import { useOwnAccount } from 'soapbox/hooks';
|
||||
import { useSigner } from 'soapbox/hooks/nostr/useSigner';
|
||||
|
||||
import RelayEditor, { RelayData } from './components/relay-editor';
|
||||
|
||||
|
@ -15,7 +16,8 @@ const messages = defineMessages({
|
|||
const NostrRelays = () => {
|
||||
const intl = useIntl();
|
||||
const { account } = useOwnAccount();
|
||||
const { relay, signer } = useNostr();
|
||||
const { relay } = useNostr();
|
||||
const { signer } = useSigner();
|
||||
|
||||
const { events } = useNostrReq(
|
||||
account?.nostr?.pubkey
|
||||
|
|
Ładowanie…
Reference in New Issue