chore: code cleanup & format

This commit is contained in:
Vlad Stan 2023-05-05 14:00:03 +03:00
parent 81e0aa26f8
commit d2e1dcc2ee

View file

@ -417,16 +417,18 @@
message: this.testData.message
}
)
console.log('### data', data)
this.testData.senderPrivateKey = data.private_key
this.$q.localStorage.set(
'lnbits.nostrclient.senderPrivateKey',
data.private_key || ''
)
const event = JSON.parse(data.event_json)[1]
console.log('### event', event)
await this.sendDataToWebSocket(data.event_json)
const subscription = JSON.stringify(["REQ", "test-dms", { "kinds": [4], "#p": [event.pubkey]}])
const subscription = JSON.stringify([
'REQ',
'test-dms',
{kinds: [4], '#p': [event.pubkey]}
])
this.testData.wsConnection.send(subscription)
} catch (error) {
LNbits.utils.notifyApiError(error)
@ -441,7 +443,8 @@
}
this.testData.wsConnection.send(data)
const separator = '='.repeat(80)
this.testData.sentData = data + `\n\n${separator}\n` + this.testData.sentData
this.testData.sentData =
data + `\n\n${separator}\n` + this.testData.sentData
} catch (error) {
this.$q.notify({
timeout: 5000,
@ -458,7 +461,8 @@
this.testData.wsConnection = new WebSocket(wsUrl)
const updateReciveData = async e => {
const separator = '='.repeat(80)
this.testData.receivedData = e.data + `\n\n${separator}\n` +this.testData.receivedData
this.testData.receivedData =
e.data + `\n\n${separator}\n` + this.testData.receivedData
}
this.testData.wsConnection.onmessage = updateReciveData
@ -469,7 +473,7 @@
var self = this
LNbits.utils.exportCSV(self.relayTable.columns, this.nostrLinks)
},
sleep: (ms) => new Promise(r => setTimeout(r, ms))
sleep: ms => new Promise(r => setTimeout(r, ms))
},
created: function () {
var self = this