Convert instance to use zod

This commit is contained in:
Alex Gleason
2023-09-23 20:41:24 -05:00
parent 970ad24de9
commit 3b630ed8fb
46 changed files with 326 additions and 195 deletions

View File

@ -6,10 +6,10 @@ import { connectRequestSchema } from 'soapbox/schemas/nostr';
import { jsonSchema } from 'soapbox/schemas/utils';
function useSignerStream() {
const { nostr } = useInstance();
const instance = useInstance();
const relayUrl = nostr.get('relay') as string | undefined;
const pubkey = nostr.get('pubkey') as string | undefined;
const relayUrl = instance.nostr?.relay;
const pubkey = instance.nostr?.pubkey;
useEffect(() => {
let relay: Relay | undefined;

View File

@ -14,7 +14,7 @@ function useTimelineStream(...args: Parameters<typeof connectTimelineStream>) {
const stream = useRef<(() => void) | null>(null);
const accessToken = useAppSelector(getAccessToken);
const streamingUrl = instance.urls.get('streaming_api');
const streamingUrl = instance.urls?.streaming_api;
const connect = () => {
if (enabled && streamingUrl && !stream.current) {