diff --git a/app/layout.tsx b/app/layout.tsx
index 42ab822..4da65f3 100644
--- a/app/layout.tsx
+++ b/app/layout.tsx
@@ -30,10 +30,10 @@ export default function RootLayout({
const customRelays = JSON.parse(localStorage.getItem("customRelays") || "[]");
if (customRelays.length > 0) {
// Remove trailing slashes from any relay URLs
- const sanitizedRelays = customRelays.map((relay: string) =>
+ const sanitizedRelays = customRelays.map((relay: string) =>
relay.endsWith('/') ? relay.slice(0, -1) : relay
);
-
+
setRelayUrls(prevRelays => {
// Combine default relays with custom relays, removing duplicates
const allRelays = [...prevRelays, ...sanitizedRelays];
@@ -61,11 +61,11 @@ export default function RootLayout({
disableTransitionOnChange
themes={["light", "dark", "purple-light", "purple-dark", "vintage-light", "vintage-dark", "neo-brutalism-light", "neo-brutalism-dark", "nature-light", "nature-dark", "system"]}
>
-
-
+
+
{children}
diff --git a/app/relays/page.tsx b/app/relays/page.tsx
index 3e0f440..5f2c23b 100644
--- a/app/relays/page.tsx
+++ b/app/relays/page.tsx
@@ -25,6 +25,13 @@ export default function RelaysPage() {
useEffect(() => {
document.title = `Relays | LUMINA`;
+ // Set a loading timeout - if relays don't connect within 10 seconds, show whatever we have
+ const loadingTimeout = setTimeout(() => {
+ if (loading) {
+ setLoading(false);
+ }
+ }, 10000);
+
if (connectedRelays) {
const status: { [url: string]: 'connected' | 'connecting' | 'disconnected' | 'error' } = {};
@@ -40,8 +47,14 @@ export default function RelaysPage() {
});
setRelayStatus(status);
- setLoading(false);
+
+ // Only stop loading when we have at least one connected relay or after a timeout
+ if (Object.values(status).some(s => s === 'connected') || connectedRelays.length === 0) {
+ setLoading(false);
+ }
}
+
+ return () => clearTimeout(loadingTimeout);
}, [connectedRelays, refreshKey]);
// Function to refresh NIP-65 relays for the current user
@@ -141,7 +154,7 @@ export default function RelaysPage() {
return (
-
Nostr Relays
+
Relays
@@ -41,11 +47,9 @@ export function TopNavigation() {