forked from cory/tildefriends
ssb: Connection result preliminary hookup to ui, and fix some fallout.
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
{
|
||||
"type": "tildefriends-app",
|
||||
"emoji": "🐌",
|
||||
"previous": "&0ZjcRFTyAmJMm3qhqKy5Ffrue23G1CAUfc1i2WYZrzQ=.sha256"
|
||||
"previous": "&+UZSxjoucLAl5r/nfRNu5KXx3K/PdutGnizL/Cn2eCU=.sha256"
|
||||
}
|
||||
|
@ -12,6 +12,7 @@ class TfTabConnectionsElement extends LitElement {
|
||||
stored_connections: {type: Array},
|
||||
users: {type: Object},
|
||||
server_identity: {type: String},
|
||||
connect_error: {type: String},
|
||||
};
|
||||
}
|
||||
|
||||
@ -163,6 +164,15 @@ class TfTabConnectionsElement extends LitElement {
|
||||
tfrpc.rpc.sync();
|
||||
}
|
||||
|
||||
connect(address) {
|
||||
let self = this;
|
||||
tfrpc.rpc.connect(address).then(function() {
|
||||
self.connect_error = 'connected!';
|
||||
}).catch(function(error) {
|
||||
self.connect_error = error;
|
||||
});
|
||||
}
|
||||
|
||||
render() {
|
||||
let self = this;
|
||||
return html`
|
||||
@ -178,10 +188,11 @@ class TfTabConnectionsElement extends LitElement {
|
||||
<button
|
||||
class="w3-button w3-theme-d1"
|
||||
@click=${() =>
|
||||
tfrpc.rpc.connect(self.renderRoot.getElementById('code').value)}
|
||||
self.connect(self.renderRoot.getElementById('code').value)}
|
||||
>
|
||||
Connect
|
||||
</button>
|
||||
<div ?hidden=${this.connect_error === undefined}>${this.connect_error}</div>
|
||||
<h2>Broadcasts</h2>
|
||||
<ul class="w3-ul w3-border">
|
||||
${this.broadcasts
|
||||
|
Reference in New Issue
Block a user