Fix error
This commit is contained in:
parent
d9c2c5b2a1
commit
eee1d8db1b
1 changed files with 13 additions and 11 deletions
|
|
@ -350,7 +350,7 @@ export class Syncer {
|
||||||
if (!metadata) {
|
if (!metadata) {
|
||||||
// Perhaps the file has been moved. Let's check by looking at the deleted files
|
// Perhaps the file has been moved. Let's check by looking at the deleted files
|
||||||
const originalFile =
|
const originalFile =
|
||||||
await findMatchingFileBasedOnHash(
|
await this.findMatchingFileBasedOnHash(
|
||||||
relativePath,
|
relativePath,
|
||||||
locallyDeletedFiles
|
locallyDeletedFiles
|
||||||
);
|
);
|
||||||
|
|
@ -614,17 +614,19 @@ export class Syncer {
|
||||||
await this.database.setLastSeenUpdateId(responseVaultUpdateId);
|
await this.database.setLastSeenUpdateId(responseVaultUpdateId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
async function findMatchingFileBasedOnHash(
|
private async findMatchingFileBasedOnHash(
|
||||||
filePath: RelativePath,
|
filePath: RelativePath,
|
||||||
candidates: [RelativePath, DocumentMetadata][]
|
candidates: [RelativePath, DocumentMetadata][]
|
||||||
): Promise<[RelativePath, DocumentMetadata] | undefined> {
|
): Promise<[RelativePath, DocumentMetadata] | undefined> {
|
||||||
const contentHash = hash(await this.operations.read(filePath));
|
const contentHash = hash(await this.operations.read(filePath));
|
||||||
|
|
||||||
if (contentHash != EMPTY_HASH) {
|
if (contentHash != EMPTY_HASH) {
|
||||||
return undefined;
|
return undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
return candidates.find(
|
||||||
|
([_, document]) => document.hash === contentHash
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return candidates.find(([_, document]) => document.hash === contentHash);
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue