Small changes

This commit is contained in:
Andras Schmelczer 2026-04-25 13:40:34 +01:00
parent 7293c58a71
commit b52c09fecc
8 changed files with 74 additions and 297 deletions

View file

@ -1,11 +1,11 @@
import type { DocumentRecord, RelativePath } from "../sync-operations/types";
import type { DocumentRecord, DocumentWithPath, RelativePath } from "../sync-operations/types";
import { EMPTY_HASH } from "./hash";
// TODO: make this smarter so that offline files can be renamed & edited at the same time
export async function findMatchingFile(
contentHash: string,
candidates: { path: RelativePath; record: DocumentRecord }[]
): Promise<{ path: RelativePath; record: DocumentRecord } | undefined> {
): Promise<DocumentWithPath | undefined> {
if (contentHash === await EMPTY_HASH) {
return undefined;
}