Browse Source

fix: incorrectly caching png file handle (#3407)

David Luzar 4 years ago
parent
commit
1e48aafb9c
2 changed files with 2 additions and 9 deletions
  1. 1 8
      src/components/ErrorDialog.tsx
  2. 1 1
      src/data/blob.ts

+ 1 - 8
src/components/ErrorDialog.tsx

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

+ 1 - 1
src/data/blob.ts

@@ -95,7 +95,7 @@ export const loadFromBlob = async (
         elements: clearElementsForExport(data.elements || []),
         appState: {
           theme: localAppState?.theme,
-          fileHandle: blob.handle ?? null,
+          fileHandle: (!blob.type.startsWith("image/") && blob.handle) || null,
           ...cleanAppStateForExport(data.appState || {}),
           ...(localAppState
             ? calculateScrollCenter(data.elements || [], localAppState, null)