diff --git a/packages/app/src/Pages/settings/Relays.tsx b/packages/app/src/Pages/settings/Relays.tsx index 2394b9a..acea320 100644 --- a/packages/app/src/Pages/settings/Relays.tsx +++ b/packages/app/src/Pages/settings/Relays.tsx @@ -31,6 +31,14 @@ const RelaySettingsPage = () => { } } + const handleNewRelayChange = (event: React.ChangeEvent) => { + const inputValue = event.target.value; + const protocol = window.location.protocol; + if ((protocol === "https:" && inputValue.startsWith("wss://")) || protocol === "http:") { + setNewRelay(inputValue); + } + }; + function addRelay() { return ( <> @@ -43,7 +51,7 @@ const RelaySettingsPage = () => { className="f-grow" placeholder="wss://my-relay.com" value={newRelay} - onChange={e => setNewRelay(e.target.value)} + onChange={handleNewRelayChange} />