This commit is contained in:
2025-05-30 19:46:43 -07:00
parent e745554b43
commit 7498d684c3
2 changed files with 19 additions and 14 deletions

View File

@@ -77,26 +77,30 @@ export class App {
renderTimer: ReturnType<typeof setTimeout>|null = null;
syncQueues: Map<string, SyncItem[]> = new Map();
syncing: Set<string> = new Set();
statusBar = "";
updateStatusBar() {
return;
// let statusBarElement = document.getElementById('status_bar');
let statusBarElement = document.getElementById('status_bar');
// if (!statusBarElement) {
// return;
// }
if (!statusBarElement) {
return;
}
// let newStatusBar = "";
let newStatusBar = "";
// for (let [userID, syncItems] of this.syncQueues.entries()) {
// let statusBarItem = `<span>${userID} - ${syncItems.length}</span>`;
for (let [userID, syncItems] of this.syncQueues.entries()) {
for (let item of syncItems) {
let {peerID, postIDs} = item;
let statusBarItem = `<span> checking ${postIDs.length} for user [${logID(userID)}] from peer [${logID(peerID)}]</span>`;
newStatusBar+= statusBarItem;
}
// newStatusBar+= statusBarItem;
// }
}
// statusBarElement.innerHTML = newStatusBar;
this.statusBar += newStatusBar;
statusBarElement.innerHTML = this.statusBar;
}
async processSyncQueue(userID: string) {
@@ -105,7 +109,7 @@ export class App {
return;
}
this.updateStatusBar();
// this.updateStatusBar();
let syncQueue = this.syncQueues.get(userID) as SyncItem[];
@@ -132,9 +136,10 @@ export class App {
}
}
// this.updateStatusBar();
this.syncing.delete(userID);
this.updateStatusBar();
}
addPostIDsToSyncQueue(userID: string, peerID: string, postIDs: string[]) {

View File

@@ -44,7 +44,7 @@ export class PeerManager {
messageSuperlog = false;
watchdogInterval: ReturnType<typeof setTimeout> |null = null;
reconnectTimer: number | null = null;
peerStateSuperlog: boolean = false;
peerStateSuperlog: boolean = true;
// async watchdog() {
// // Check that we're connected to at least N peers. If not, reconnect to the bootstrap server.