Maybe avoid increating load with the wiki app as requested accrue.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4609 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
Cory McWilliams 2023-11-05 01:07:08 +00:00
parent 61a3226e14
commit 6ef14d985d
3 changed files with 5 additions and 3 deletions

View File

@ -1,5 +1,5 @@
{
"type": "tildefriends-app",
"emoji": "📝",
"previous": "&uHuaLkW5F8E1aJ58hpoz72hWZZHIT2gaExUFSb8D6eI=.sha256"
"previous": "&5DCHb4dlFnAlInCiIb1v7XG+w/t11fVwbpqM8aVLEfQ=.sha256"
}

View File

@ -67,7 +67,6 @@ ssb.addEventListener('message', function(id) {
core.register('message', async function message_handler(message) {
if (message.event == 'hashChange') {
print('hash change', message.hash);
g_hash = message.hash;
await tfrpc.rpc.hash_changed(message.hash);
}
@ -112,7 +111,6 @@ async function process_message(whoami, collection, message, kind, parent) {
} else {
content.draft = false;
}
print(message.id, content);
if (content?.key) {
if (content?.tombstone) {
delete collection[content.key];

View File

@ -53,11 +53,15 @@ class TfCollectionsAppElement extends LitElement {
if (!this.wiki?.id) {
return;
}
let start_id = this.wiki.id;
let max_rowid;
let wiki_docs;
while (true)
{
[max_rowid, wiki_docs] = await tfrpc.rpc.collection(this.owner_ids, 'wiki-doc', this.wiki?.id, max_rowid, wiki_docs);
if (this.wiki?.id !== start_id) {
break;
}
this.wiki_docs = wiki_docs;
this.update_wiki_doc();
}