ssb: prettier.
Some checks failed
Build Tilde Friends / Build-All (push) Has been cancelled

This commit is contained in:
Cory McWilliams 2025-04-09 22:15:51 -04:00
parent d9684c7d62
commit 67d458bd38
3 changed files with 38 additions and 14 deletions

View File

@ -177,7 +177,14 @@ class TfElement extends LitElement {
const k_chunk_size = 1024; const k_chunk_size = 1024;
let min_row_id = 0; let min_row_id = 0;
console.log('loading about for', ids.length, 'accounts', cache.last_row_id, '=>', max_row_id); console.log(
'loading about for',
ids.length,
'accounts',
cache.last_row_id,
'=>',
max_row_id
);
try { try {
while (true) { while (true) {
let abouts = await tfrpc.rpc.query( let abouts = await tfrpc.rpc.query(
@ -229,7 +236,14 @@ class TfElement extends LitElement {
} }
max_seen = about.rowid; max_seen = about.rowid;
} }
console.log('cache =', cache.last_row_id, 'seen =', max_seen, 'max =', max_row_id); console.log(
'cache =',
cache.last_row_id,
'seen =',
max_seen,
'max =',
max_row_id
);
cache.last_row_id = Math.max(cache.last_row_id, max_seen ?? max_row_id); cache.last_row_id = Math.max(cache.last_row_id, max_seen ?? max_row_id);
min_row_id = Math.max(min_row_id, max_seen ?? max_row_id); min_row_id = Math.max(min_row_id, max_seen ?? max_row_id);
let new_cache = JSON.stringify(cache); let new_cache = JSON.stringify(cache);

View File

@ -431,12 +431,17 @@ class TfMessageElement extends LitElement {
> >
Copy ID Copy ID
</button> </button>
${this.drafts[this.message?.id] === undefined ? html` ${this.drafts[this.message?.id] === undefined
<button class="w3-button w3-bar-item" @click=${this.show_reply}> ? html`
Reply <button class="w3-button w3-bar-item" @click=${this.show_reply}>
</button> Reply
` : undefined} </button>
<button class="w3-button w3-bar-item w3-border-bottom" @click=${this.react}> `
: undefined}
<button
class="w3-button w3-bar-item w3-border-bottom"
@click=${this.react}
>
👍 React 👍 React
</button> </button>
${formats.map( ${formats.map(
@ -541,8 +546,7 @@ class TfMessageElement extends LitElement {
: undefined; : undefined;
return html` return html`
<div class="w3-section w3-container"> <div class="w3-section w3-container">
${reply} ${reply} ${this.render_children()}
${this.render_children()}
</div> </div>
`; `;
} }

View File

@ -81,16 +81,22 @@ class TfTabNewsFeedElement extends LitElement {
`, `,
[JSON.stringify(combined.map((x) => x.id))] [JSON.stringify(combined.map((x) => x.id))]
); );
return [].concat(combined, await tfrpc.rpc.query( return [].concat(
` combined,
await tfrpc.rpc.query(
`
SELECT FALSE AS is_primary, messages.rowid, messages.id, messages.previous, messages.author, messages.sequence, messages.timestamp, messages.hash, json(messages.content) AS content, messages.signature SELECT FALSE AS is_primary, messages.rowid, messages.id, messages.previous, messages.author, messages.sequence, messages.timestamp, messages.hash, json(messages.content) AS content, messages.signature
FROM messages FROM messages
JOIN json_each(?2) refs ON messages.id = refs.value JOIN json_each(?2) refs ON messages.id = refs.value
JOIN json_each(?1) AS following ON messages.author = following.value JOIN json_each(?1) AS following ON messages.author = following.value
WHERE messages.content ->> 'type' = 'vote' WHERE messages.content ->> 'type' = 'vote'
`, `,
[JSON.stringify(this.following), JSON.stringify(refs2.map((x) => x.ref))] [
)); JSON.stringify(this.following),
JSON.stringify(refs2.map((x) => x.ref)),
]
)
);
} }
async fetch_messages(start_time, end_time) { async fetch_messages(start_time, end_time) {