Real-time collaboration within space (#411)

This commit is contained in:
Zef Hemel
2023-06-13 20:47:05 +02:00
committed by GitHub
parent 063a8e4767
commit 8e0a7cf177
54 changed files with 1358 additions and 187 deletions
+7 -1
View File
@@ -37,7 +37,10 @@ export class SpaceSync {
) {
}
async syncFiles(snapshot: Map<string, SyncStatusItem>): Promise<number> {
async syncFiles(
snapshot: Map<string, SyncStatusItem>,
isSyncCandidate = this.options.isSyncCandidate,
): Promise<number> {
let operations = 0;
console.log("[sync]", "Fetching snapshot from primary");
const primaryAllPages = this.syncCandidates(
@@ -73,6 +76,9 @@ export class SpaceSync {
// console.log("[sync]", "Iterating over all files");
let filesProcessed = 0;
for (const name of sortedFilenames) {
if (isSyncCandidate && !isSyncCandidate(name)) {
continue;
}
try {
operations += await this.syncFile(
snapshot,