mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-09-20 16:00:38 +02:00
Include runtime types, otherwise ts goes crazy
This commit is contained in:
@@ -83,6 +83,7 @@ export const AIComponents = ({
|
||||
}
|
||||
|
||||
try {
|
||||
// @ts-expect-error
|
||||
const { html } = await response.json();
|
||||
|
||||
if (!html) {
|
||||
@@ -140,9 +141,11 @@ export const AIComponents = ({
|
||||
};
|
||||
}
|
||||
|
||||
// @ts-expect-error
|
||||
throw new Error(json.message || "Generation failed...");
|
||||
}
|
||||
|
||||
// @ts-expect-error
|
||||
const generatedResponse = json.generatedResponse;
|
||||
if (!generatedResponse) {
|
||||
throw new Error("Generation failed...");
|
||||
|
@@ -309,19 +309,23 @@ export const exportToBackend = async (
|
||||
body: payload.buffer,
|
||||
});
|
||||
const json = await response.json();
|
||||
// @ts-expect-error
|
||||
if (json.id) {
|
||||
const url = new URL(window.location.href);
|
||||
// We need to store the key (and less importantly the id) as hash instead
|
||||
// of queryParam in order to never send it to the server
|
||||
// @ts-expect-error
|
||||
url.hash = `json=${json.id},${encryptionKey}`;
|
||||
const urlString = url.toString();
|
||||
|
||||
await saveFilesToFirebase({
|
||||
// @ts-expect-error
|
||||
prefix: `/files/shareLinks/${json.id}`,
|
||||
files: filesToUpload,
|
||||
});
|
||||
|
||||
return { url: urlString, errorMessage: null };
|
||||
// @ts-expect-error
|
||||
} else if (json.error_class === "RequestTooLargeError") {
|
||||
return {
|
||||
url: null,
|
||||
|
Reference in New Issue
Block a user