Add wss:// to user relays by default (#1412)
This commit is contained in:
parent
5088673b84
commit
dcbe83f155
|
@ -618,7 +618,7 @@ export const settingsSchema = object().shape({
|
|||
string().nullable().matches(NOSTR_PUBKEY_HEX, 'must be 64 hex chars'),
|
||||
string().nullable().matches(NOSTR_PUBKEY_BECH32, 'invalid bech32 encoding')], 'invalid pubkey'),
|
||||
nostrRelays: array().of(
|
||||
string().ws()
|
||||
string().ws().transform(relay => relay.startsWith('wss://') ? relay : `wss://${relay}`)
|
||||
).max(NOSTR_MAX_RELAY_NUM,
|
||||
({ max, value }) => `${Math.abs(max - value.length)} too many`),
|
||||
hideBookmarks: boolean(),
|
||||
|
|
|
@ -170,7 +170,9 @@ export default function Settings ({ ssrData }) {
|
|||
}
|
||||
}
|
||||
|
||||
const nostrRelaysFiltered = nostrRelays?.filter(word => word.trim().length > 0)
|
||||
const nostrRelaysFiltered = nostrRelays
|
||||
?.filter(word => word.trim().length > 0)
|
||||
.map(relay => relay.startsWith('wss://') ? relay : `wss://${relay}`)
|
||||
|
||||
try {
|
||||
await setSettings({
|
||||
|
|
Loading…
Reference in New Issue