Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions web/src/artifact_cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,10 @@ interface CrossOriginStorageWritable {
}

interface CrossOriginStorageAPI {
requestFileHandles(
descriptors: CrossOriginHashDescriptor[],
requestFileHandle(
descriptor: CrossOriginHashDescriptor,
options?: CrossOriginStorageRequestFileHandleOptions,
): Promise<CrossOriginStorageHandle[]>;
): Promise<CrossOriginStorageHandle>;
}

declare global {
Expand Down Expand Up @@ -169,8 +169,7 @@ class CrossOriginStorage {
if (!api) {
return undefined;
}
const handles = await api.requestFileHandles([hash]);
const handle = handles[0];
const handle = await api.requestFileHandle(hash);
if (!handle) {
return undefined;
}
Expand All @@ -189,10 +188,9 @@ class CrossOriginStorage {
if (!api) {
throw new Error("Cross-origin storage API unavailable.");
}
const handles = await api.requestFileHandles([hash], { create: true });
const handle = handles[0];
const handle = await api.requestFileHandle(hash, { create: true });
if (!handle) {
throw new Error("Cross-origin storage API returned no handles.");
throw new Error("Cross-origin storage API returned no handle.");
}
const writableStream = await handle.createWritable();
await writableStream.write(blob);
Expand Down
Loading