ssb: Move the refresh/sync button to the navigation bar as an experiment.

This commit is contained in:
Cory McWilliams 2024-11-23 16:49:33 -05:00
parent f9ec796291
commit b6bfdec48d
3 changed files with 12 additions and 14 deletions

View File

@ -1,5 +1,5 @@
{ {
"type": "tildefriends-app", "type": "tildefriends-app",
"emoji": "🐌", "emoji": "🐌",
"previous": "&FhsefvQQwZ9T4+HoInU3di3T+7B7CVC3xyjpLtGqyr8=.sha256" "previous": "&Cqu8pxYxC8fBQuUpa3z2kVnX5cqbQ+p5mhqySZwWwb4=.sha256"
} }

View File

@ -321,6 +321,10 @@ class TfElement extends LitElement {
} }
} }
refresh() {
tfrpc.rpc.sync();
}
render() { render() {
let self = this; let self = this;
@ -341,6 +345,12 @@ class TfElement extends LitElement {
let tabs = html` let tabs = html`
<div class="w3-bar w3-theme-l1"> <div class="w3-bar w3-theme-l1">
<button
class="w3-bar-item w3-button w3-circle w3-ripple"
@click=${this.refresh}
>
</button>
${Object.entries(k_tabs).map( ${Object.entries(k_tabs).map(
([k, v]) => html` ([k, v]) => html`
<button <button

View File

@ -178,10 +178,6 @@ class TfTabConnectionsElement extends LitElement {
`; `;
} }
refresh() {
tfrpc.rpc.sync();
}
connect(address) { connect(address) {
let self = this; let self = this;
self.connect_attempt = address; self.connect_attempt = address;
@ -207,12 +203,6 @@ class TfTabConnectionsElement extends LitElement {
let self = this; let self = this;
return html` return html`
<div class="w3-container" style="box-sizing: border-box"> <div class="w3-container" style="box-sizing: border-box">
<button
class="w3-button w3-theme-l3 w3-circle w3-ripple w3-large"
@click=${this.refresh}
>
</button>
<h2>New Connection</h2> <h2>New Connection</h2>
<textarea class="w3-input w3-theme-d1" id="code"></textarea> <textarea class="w3-input w3-theme-d1" id="code"></textarea>
${this.render_message(this.renderRoot.getElementById('code')?.value)} ${this.render_message(this.renderRoot.getElementById('code')?.value)}
@ -227,9 +217,7 @@ class TfTabConnectionsElement extends LitElement {
<ul class="w3-ul w3-border"> <ul class="w3-ul w3-border">
${this.broadcasts ${this.broadcasts
.filter((x) => x.address) .filter((x) => x.address)
.filter( .filter((x) => self.connections.map(c => c.id).indexOf(x.pubkey) == -1)
(x) => self.connections.map((c) => c.id).indexOf(x.pubkey) == -1
)
.map((x) => self.render_broadcast(x))} .map((x) => self.render_broadcast(x))}
</ul> </ul>
<h2>Connections</h2> <h2>Connections</h2>