improve relay connection
This commit is contained in:
@@ -12,14 +12,14 @@ import { QUOTES } from '@stores/constants';
|
||||
|
||||
interface NDKContext {
|
||||
ndk: undefined | NDK;
|
||||
fetcher: undefined | NostrFetcher;
|
||||
relayUrls: string[];
|
||||
fetcher: NostrFetcher;
|
||||
}
|
||||
|
||||
const NDKContext = createContext<NDKContext>({
|
||||
ndk: undefined,
|
||||
relayUrls: [],
|
||||
fetcher: undefined,
|
||||
relayUrls: [],
|
||||
});
|
||||
|
||||
const NDKProvider = ({ children }: PropsWithChildren<object>) => {
|
||||
|
||||
@@ -406,7 +406,7 @@ export class LumeStorage {
|
||||
`SELECT * FROM relays WHERE account_id = "${this.account.id}" ORDER BY id DESC LIMIT 50;`
|
||||
);
|
||||
|
||||
if (!result || result.length < 1) return FULL_RELAYS;
|
||||
if (!result || !result.length) return FULL_RELAYS;
|
||||
return result.map((el) => el.relay);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user