From 04f1d692a44123331129ee92443c92f9254403f4 Mon Sep 17 00:00:00 2001 From: enes Date: Mon, 20 Jan 2025 20:06:18 +0100 Subject: [PATCH 1/2] fix(relays): allow adding ws:// Closes #297 --- src/pages/settings/relays/index.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/pages/settings/relays/index.tsx b/src/pages/settings/relays/index.tsx index b2c102e..e210ac5 100644 --- a/src/pages/settings/relays/index.tsx +++ b/src/pages/settings/relays/index.tsx @@ -54,7 +54,10 @@ export const RelaysPage = () => { const relayMap = useAppSelector((state) => state.relays?.map) const relaysInfo = useAppSelector((state) => state.relays?.info) - const webSocketPrefix = 'wss://' + const webSocketPrefix = + newRelayURI?.startsWith('wss://') || newRelayURI?.startsWith('ws://') + ? '' + : 'wss://' // fetch relay list from relays useEffect(() => { @@ -197,7 +200,7 @@ export const RelaysPage = () => { // Check if new relay URI is a valid string if ( relayURI && - !/^wss:\/\/[-a-zA-Z0-9@:%._\\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}/.test( + !/^wss?:\/\/[-a-zA-Z0-9@:%._\\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}/.test( relayURI ) ) { From 5f3d92d62f1f958f3e93ed4c9cd879c88a5c5d6c Mon Sep 17 00:00:00 2001 From: enes Date: Mon, 20 Jan 2025 20:14:44 +0100 Subject: [PATCH 2/2] fix(relays): relay add button size height Closes #244 --- src/pages/settings/relays/index.tsx | 8 +++++++- src/pages/settings/relays/style.module.scss | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/pages/settings/relays/index.tsx b/src/pages/settings/relays/index.tsx index e210ac5..c0542c5 100644 --- a/src/pages/settings/relays/index.tsx +++ b/src/pages/settings/relays/index.tsx @@ -263,7 +263,13 @@ export const RelaysPage = () => { }} className={styles.relayURItextfield} /> - diff --git a/src/pages/settings/relays/style.module.scss b/src/pages/settings/relays/style.module.scss index a5654c5..3db7760 100644 --- a/src/pages/settings/relays/style.module.scss +++ b/src/pages/settings/relays/style.module.scss @@ -12,6 +12,7 @@ flex-direction: row; gap: 10px; width: 100%; + align-items: start; } .sectionIcon {