Split out the concept of headless and an archive peer. Add better logging for URL params

This commit is contained in:
2025-05-18 21:30:04 -07:00
parent 3905368bbb
commit 2e8b2fe14c
3 changed files with 31 additions and 159 deletions

View File

@@ -2,11 +2,13 @@ import { openDatabase, getData, addData, addDataArray, clearData, deleteData, me
import { log, logID } from "log";
export class Sync {
isArchivePeer:boolean = false;
userID: string = "";
userIDsToSync: Set<string> = new Set();
constructor() {
setArchive(isHeadless:boolean) {
this.isArchivePeer = isHeadless;
}
setUserID(userID: string) {
@@ -14,7 +16,12 @@ export class Sync {
}
shouldSyncUserID(userID: string) {
return true;
let shouldSyncAllUsers = this.isArchivePeer;
if (shouldSyncAllUsers) {
return true;
}
return this.userIDsToSync.has(userID);
}
// shouldSyncUserID(userID: string) {