浏览代码

fix: Don't show save file to disk when UIOptions.canvasActions.export.saveFileToDisk is false (#4073)

Aakansha Doshi 3 年之前
父节点
当前提交
bc88cf5002
共有 2 个文件被更改,包括 3 次插入1 次删除
  1. 2 0
      src/packages/excalidraw/CHANGELOG.md
  2. 1 1
      src/packages/excalidraw/index.tsx

+ 2 - 0
src/packages/excalidraw/CHANGELOG.md

@@ -33,6 +33,8 @@ Please add the latest change on the top under the correct section.
 
 
 ### Fixes
 ### Fixes
 
 
+- Don't show save file to disk button in export dialog when `saveFileToDisk` passed as `false` in [`UIOptions.canvasActions.export`](https://github.com/excalidraw/excalidraw/blob/master/src/packages/excalidraw/README.md#exportOpts).
+
 - [`onPaste`](https://github.com/excalidraw/excalidraw/blob/master/src/packages/excalidraw/README.md#onPaste) prop should return false to prevent the native excalidraw paste action [#3974](https://github.com/excalidraw/excalidraw/pull/3974).
 - [`onPaste`](https://github.com/excalidraw/excalidraw/blob/master/src/packages/excalidraw/README.md#onPaste) prop should return false to prevent the native excalidraw paste action [#3974](https://github.com/excalidraw/excalidraw/pull/3974).
 
 
   #### BREAKING CHANGE
   #### BREAKING CHANGE

+ 1 - 1
src/packages/excalidraw/index.tsx

@@ -47,7 +47,7 @@ const Excalidraw = (props: ExcalidrawProps) => {
 
 
   if (canvasActions?.export) {
   if (canvasActions?.export) {
     UIOptions.canvasActions.export.saveFileToDisk =
     UIOptions.canvasActions.export.saveFileToDisk =
-      canvasActions.export?.saveFileToDisk ||
+      canvasActions.export?.saveFileToDisk ??
       DEFAULT_UI_OPTIONS.canvasActions.export.saveFileToDisk;
       DEFAULT_UI_OPTIONS.canvasActions.export.saveFileToDisk;
   }
   }