fix: ai ppt preview with toolbar widget (#8882)

Fix issue [AF-1716](https://linear.app/affine-design/issue/AF-1716).
This commit is contained in:
akumatus
2024-11-21 06:56:26 +00:00
parent a6232849e3
commit c6ac426b4c
2 changed files with 5 additions and 3 deletions
@@ -438,12 +438,13 @@ Could you make a new website based on these notes and send back just the html fi
const url = new URL(getBaseUrl() + '/api/copilot/unsplash/photos');
url.searchParams.set('query', options.query);
const result: {
results: {
results?: {
urls: {
regular: string;
};
}[];
} = await fetch(url.toString()).then(res => res.json());
if (!result.results) return [];
return result.results.map(r => {
const url = new URL(r.urls.regular);
url.searchParams.set('fit', 'crop');