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