Skip to content

Commit

Permalink
Merge pull request #178 from pihart/file-upload-should-add-to-history…
Browse files Browse the repository at this point in the history
…-177

File upload should add to history
  • Loading branch information
pihart authored Jun 12, 2021
2 parents 3bc67d3 + 8d85745 commit 1f6857f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
9 changes: 3 additions & 6 deletions src/components/Overlay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ const Overlay = ({ qboard }: { qboard: QBoard }): JSX.Element => {
return (
<>
<VirtualFileInput
acceptFiles={qboard.files.acceptFile}
acceptFiles={async (file) =>
qboard.history.execute((await qboard.files.acceptFile(file)).history)
}
captureRef={(ref) => {
qboard.globalState.fileInputRef = ref;
}}
Expand Down Expand Up @@ -109,11 +111,6 @@ const Overlay = ({ qboard }: { qboard: QBoard }): JSX.Element => {
<Stylebar
currentStyle={state.currentStyle}
doAction={qboard.action.doAction}
acceptFile={async (file) =>
qboard.history.execute(
(await qboard.files.acceptFile(file)).history
)
}
visibility={visibility}
isMobile={isMobile}
/>
Expand Down
1 change: 0 additions & 1 deletion src/components/Stylebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import StyleMenu from "./StyleMenu";
const Stylebar = (props: {
currentStyle: Style;
doAction: (action: Action) => void;
acceptFile: (files: FileList) => Promise<void | void[]>;
visibility: Visibility;
isMobile: boolean;
}): JSX.Element => {
Expand Down

0 comments on commit 1f6857f

Please sign in to comment.