some small fixes.

This commit is contained in:
fiatjaf
2021-02-17 18:07:34 -03:00
parent 0e1c23a3f9
commit 87de1310b5
2 changed files with 4 additions and 9 deletions

View File

@@ -29,9 +29,7 @@ export function relayConnect(url, onNotice) {
var channels = {}
function connect() {
ws = new WebSocket(
url + (url.indexOf('?') !== -1 ? '&' : '?') + `session=${Math.random()}`
)
ws = new WebSocket(url)
ws.onopen = () => {
console.log('connected to', url)
@@ -135,7 +133,7 @@ export function relayConnect(url, onNotice) {
url,
sub: R.partial(sub, [sha256(Math.random().toString())]),
async publish(event) {
trySend(JSON.stringify(event))
trySend(JSON.stringify(['EVENT', event]))
},
close() {
ws.close()