(
};
if (!isEditorStateInitialized) {
- console.log('resetting');
- // setEditorState(EditorState.set(editorState, { decorator: defaultDecorators }));
updateFromHtml(defaultHtmlValue || '');
}
diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx
index bf00822..83cc546 100644
--- a/src/pages/_app.tsx
+++ b/src/pages/_app.tsx
@@ -1,4 +1,4 @@
-import { AppProps } from 'next/dist/next-server/lib/router/router';
+import { AppProps } from 'next/dist/pages/_app';
import React from 'react';
import '../styles/globals.css';
diff --git a/src/pages/api/optimize.ts b/src/pages/api/optimize.ts
index 83cd7fb..88af931 100644
--- a/src/pages/api/optimize.ts
+++ b/src/pages/api/optimize.ts
@@ -12,10 +12,10 @@ export default async (req: NextApiRequest, res: NextApiResponse) => {
res.status(404).end();
}
- const { svgString, ...opts } = req.body;
+ const { svgString, datauri, ...opts } = req.body;
try {
- res.status(200).json(await getSvgo(opts).optimize(svgString));
+ res.status(200).json(getSvgo(svgString, datauri, opts));
} catch (error) {
res.status(500).json({ error });
}
diff --git a/src/pages/optimize/index.tsx b/src/pages/optimize/index.tsx
index 012ae20..5e8e67c 100644
--- a/src/pages/optimize/index.tsx
+++ b/src/pages/optimize/index.tsx
@@ -111,7 +111,7 @@ export default function Home() {
setUriSvg('');
});
} else {
- setOptimizedSvg({});
+ setOptimizedSvg(undefined);
setOriginalSvg('');
setUriSvg('');
}
@@ -231,7 +231,7 @@ export default function Home() {
-
+