Skip to content

Commit

Permalink
Update file extension check for Firefox
Browse files Browse the repository at this point in the history
Modified the browser check condition for Firefox to include both 'cif' and 'mmcif' file extensions. This is to prevent potential issues since these types of files are currently unsupported on the Firefox browser.
  • Loading branch information
Dialpuri committed Jun 22, 2024
1 parent af5808c commit a2c41b3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion webapp/src/routes/Home/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,9 @@ export default function Home(): Element {
const newFileName = '/coordinates.' + fileExtension;
Module.FS.writeFile(newFileName, fileContent);

const disallowedExtensions = ["cif", "mmcif"]
const browser = detect(); // FireFox doesn't work with CIF files, get the PDB.
if (browser.name === 'firefox' && fileExtension === 'cif') {
if (browser.name === 'firefox' && disallowedExtensions.includes(fileExtension)) {
setFailureText(
'CIF files are currently unsupported on FireFox. Please consider an alternate browser.'
);
Expand Down

0 comments on commit a2c41b3

Please sign in to comment.