improvement: Tweak error message on image import (#2619)

* improvement: tweak error message on image import

* tweak copy
This commit is contained in:
David Luzar 2020-12-20 16:11:44 +01:00 committed by GitHub
parent 4a89aba682
commit b997e69ebc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 3 deletions

View File

@ -28,7 +28,14 @@ export const ErrorDialog = ({
onCloseRequest={handleClose} onCloseRequest={handleClose}
title={t("errorDialog.title")} title={t("errorDialog.title")}
> >
<div>{message}</div> <div>
{message.split("\n").map((line) => (
<>
{line}
<br />
</>
))}
</div>
</Dialog> </Dialog>
)} )}
</> </>

View File

@ -9,7 +9,7 @@ import { AppState } from "../types";
import { restore } from "./restore"; import { restore } from "./restore";
import { ImportedDataState, LibraryData } from "./types"; import { ImportedDataState, LibraryData } from "./types";
export const parseFileContents = async (blob: Blob | File) => { const parseFileContents = async (blob: Blob | File) => {
let contents: string; let contents: string;
if (blob.type === "image/png") { if (blob.type === "image/png") {

View File

@ -136,7 +136,7 @@
"loadSceneOverridePrompt": "Loading external drawing will replace your existing content. Do you wish to continue?", "loadSceneOverridePrompt": "Loading external drawing will replace your existing content. Do you wish to continue?",
"errorLoadingLibrary": "There was an error loading the third party library.", "errorLoadingLibrary": "There was an error loading the third party library.",
"confirmAddLibrary": "This will add {{numShapes}} shape(s) to your library. Are you sure?", "confirmAddLibrary": "This will add {{numShapes}} shape(s) to your library. Are you sure?",
"imageDoesNotContainScene": "Image file doesn't contain scene data. Have you enabled this during export?", "imageDoesNotContainScene": "Importing images isn't supported at the moment.\n\nDid you want to import a scene? This image does not seem to contain any scene data. Have you enabled this during export?",
"cannotRestoreFromImage": "Scene couldn't be restored from this image file" "cannotRestoreFromImage": "Scene couldn't be restored from this image file"
}, },
"toolBar": { "toolBar": {

View File

@ -38,6 +38,7 @@ Please add the latest change on the top under the correct section.
### Improvements ### Improvements
- Improve error message around importing images [#2619](https://github.com/excalidraw/excalidraw/pull/2619)
- Add tooltip with icon for embedding scenes [#2532](https://github.com/excalidraw/excalidraw/pull/2532) - Add tooltip with icon for embedding scenes [#2532](https://github.com/excalidraw/excalidraw/pull/2532)
- RTL support for the stats dialog [#2530](https://github.com/excalidraw/excalidraw/pull/2530) - RTL support for the stats dialog [#2530](https://github.com/excalidraw/excalidraw/pull/2530)
- Expand canvas padding based on zoom. [#2515](https://github.com/excalidraw/excalidraw/pull/2515) - Expand canvas padding based on zoom. [#2515](https://github.com/excalidraw/excalidraw/pull/2515)