Skip to content

Commit

Permalink
Send path instead of buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
manhtai committed Jul 25, 2021
1 parent 7e60613 commit c470cbd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/qrcode/QrCodeReader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ const QRCodeReader = () => {
const handleOpen = async () => {
setOpening(true);
const filters = [{ name: 'Images', extensions: ['jpg', 'jpeg', 'png'] }];
const buff = await ipcRenderer.invoke('open-file', filters);
setImage(nativeImage.createFromBuffer(buff));
const path = await ipcRenderer.invoke('open-file', filters, 'path');
setImage(nativeImage.createFromPath(path));
setOpening(false);
};

Expand Down

0 comments on commit c470cbd

Please sign in to comment.