mirror of
https://gitlab.com/soapbox-pub/mkstack.git
synced 2026-12-05 16:33:36 +00:00
Add Blossom server list to app config (kind 10063)
Blossom servers now live in AppConfig alongside the NIP-65 relay list: - blossomServerMetadata (BUD-03 server list) and useAppBlossomServers flag - src/lib/appBlossom.ts provides APP_BLOSSOM_SERVERS defaults (blossom.ditto.pub, blossom.dreamith.to, blossom.primal.net), parseBlossomServerList, and getEffectiveBlossomServers - NostrSync hydrates the user's kind 10063 event on login - useUploadFile reads effective servers from config
This commit is contained in:
7 files changed
+171
-7
No files matched your search
@@ -1,7 +1,7 @@
|
||||
import { ReactNode, useEffect } from 'react';
|
||||
import { z } from 'zod';
|
||||
import { useLocalStorage } from '@/hooks/useLocalStorage';
|
||||
import { AppContext, type AppConfig, type AppContextType, type Theme, type RelayMetadata } from '@/contexts/AppContext';
|
||||
import { AppContext, type AppConfig, type AppContextType, type Theme, type RelayMetadata, type BlossomServerMetadata } from '@/contexts/AppContext';
|
||||
|
||||
interface AppProviderProps {
|
||||
children: ReactNode;
|
||||
@@ -21,10 +21,18 @@ const RelayMetadataSchema = z.object({
|
||||
updatedAt: z.number(),
|
||||
}) satisfies z.ZodType<RelayMetadata>;
|
||||
|
||||
// Zod schema for BlossomServerMetadata validation
|
||||
const BlossomServerMetadataSchema = z.object({
|
||||
servers: z.array(z.url()),
|
||||
updatedAt: z.number(),
|
||||
}) satisfies z.ZodType<BlossomServerMetadata>;
|
||||
|
||||
// Zod schema for AppConfig validation
|
||||
const AppConfigSchema = z.object({
|
||||
theme: z.enum(['dark', 'light', 'system']),
|
||||
relayMetadata: RelayMetadataSchema,
|
||||
blossomServerMetadata: BlossomServerMetadataSchema,
|
||||
useAppBlossomServers: z.boolean(),
|
||||
}) satisfies z.ZodType<AppConfig>;
|
||||
|
||||
export function AppProvider(props: AppProviderProps) {
|
||||
|
||||
Reference in new issue
Block a user