diff --git a/app/web/src/App.svelte b/app/web/src/App.svelte index 0c5db92..768fda0 100644 --- a/app/web/src/App.svelte +++ b/app/web/src/App.svelte @@ -236,7 +236,8 @@ console.log("Delete event tags:", signedDeleteEvent.tags); // Publish to the ORLY relay using WebSocket authentication - const relayUrl = `wss://${window.location.host}`; + const wsProtocol = window.location.protocol.startsWith('https') ? 'wss:' : 'ws:'; + const relayUrl = `${wsProtocol}//${window.location.host}/`; try { const result = await publishEventWithAuth( @@ -381,7 +382,8 @@ } else { // Admin/owner deleting someone else's event - only publish to local relay // We need to publish only to the local relay, not external ones - const localRelayUrl = `wss://${window.location.host}/`; + const wsProto = window.location.protocol.startsWith('https') ? 'wss:' : 'ws:'; + const localRelayUrl = `${wsProto}//${window.location.host}/`; // Create a modified client that only connects to the local relay const localClient = new NostrClient(); @@ -636,7 +638,8 @@ } try { - const localRelayUrl = `wss://${window.location.host}/`; + const wsProto = window.location.protocol.startsWith('https') ? 'wss:' : 'ws:'; + const localRelayUrl = `${wsProto}//${window.location.host}/`; console.log( "Reposting event to local relay:", localRelayUrl, @@ -698,7 +701,8 @@ try { // Get user's write relays const writeRelays = await getUserWriteRelays(); - const localRelayUrl = `wss://${window.location.host}/`; + const wsProto = window.location.protocol.startsWith('https') ? 'wss:' : 'ws:'; + const localRelayUrl = `${wsProto}//${window.location.host}/`; // Always include local relay const allRelays = [ @@ -2603,7 +2607,8 @@ } // Publish to the ORLY relay using WebSocket (same address as current page) - const relayUrl = `wss://${window.location.host}`; + const wsProtocol = window.location.protocol.startsWith('https') ? 'wss:' : 'ws:'; + const relayUrl = `${wsProtocol}//${window.location.host}/`; // Use the authentication module to publish the event const result = await publishEventWithAuth( diff --git a/app/web/src/constants.js b/app/web/src/constants.js index 9da0b87..a841bf7 100644 --- a/app/web/src/constants.js +++ b/app/web/src/constants.js @@ -1,8 +1,10 @@ // Default Nostr relays for searching +// Use startsWith to avoid minifier optimization issues +const wsProtocol = window.location.protocol.startsWith('https') ? 'wss:' : 'ws:'; export const DEFAULT_RELAYS = [ // Use the local relay WebSocket endpoint // Automatically use ws:// for http:// and wss:// for https:// - `${window.location.protocol === 'https:' ? 'wss:' : 'ws:'}//${window.location.host}/`, + `${wsProtocol}//${window.location.host}/`, ]; // Replaceable kinds for the recovery dropdown diff --git a/pkg/version/version b/pkg/version/version index 5203324..6b8706c 100644 --- a/pkg/version/version +++ b/pkg/version/version @@ -1 +1 @@ -v0.36.2 +v0.36.3