Skip to content

Commit

Permalink
#3091 – Cannot open CDX files on Mac (#3092)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nitvex authored Aug 14, 2023
1 parent 02d29a0 commit 031579e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/ketcher-react/src/script/ui/utils/fileOpener.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,13 @@ function throughFileReader(file) {
const rd = new FileReader(); // eslint-disable-line no-undef

rd.onload = () => {
const content = isCDX ? rd.result.slice(37) : rd.result;
let content;
if (isCDX) {
const base64String = rd.result.split(',').at(-1);
content = base64String;
} else {
content = rd.result;
}
if (file.msClose) file.msClose();
resolve(content);
};
Expand Down

0 comments on commit 031579e

Please sign in to comment.