fix: allow ws:// relays

This commit is contained in:
Vlad Stan 2023-02-23 11:58:56 +02:00
parent f601ca38f6
commit 752fad2e3c

View file

@ -73,6 +73,7 @@
icon="cancel"
color="pink"
></q-btn>
</q-td>
</q-tr>
</template>
{% endraw %}
@ -203,14 +204,17 @@
})
},
addRelay() {
if (!this.relayToAdd.startsWith("wss://")) {
this.relayToAdd = ""
if (
!this.relayToAdd.startsWith('wss://') &&
!this.relayToAdd.startsWith('ws://')
) {
this.relayToAdd = ''
this.$q.notify({
timeout: 5000,
type: 'warning',
message: `Invalid relay URL.`,
caption: "Should start with wss://"
})
timeout: 5000,
type: 'warning',
message: `Invalid relay URL.`,
caption: "Should start with 'wss://'' or 'ws://'"
})
return
}
console.log("ADD RELAY " + this.relayToAdd)