fix: album asset sync must sync new assets in a shared album (#20655)

This commit is contained in:
Zack Pollard 2025-08-05 17:53:51 +01:00 committed by GitHub
parent 09a5963eee
commit 02381343ff
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 928 additions and 453 deletions

View file

@ -446,6 +446,16 @@ export async function* makeStream<T>(items: T[] = []): AsyncIterableIterator<T>
}
}
export const wait = (ms: number) => {
return new Promise((resolve) => setTimeout(resolve, ms));
export const wait = (ms: number): Promise<void> => {
return new Promise((resolve) => {
const target = performance.now() + ms;
const checkDone = () => {
if (performance.now() >= target) {
resolve();
} else {
setTimeout(checkDone, 1); // Check again after 1ms
}
};
setTimeout(checkDone, ms);
});
};