Skip to content

Commit

Permalink
Handle params in URL when parsing extension (fixes #2)
Browse files Browse the repository at this point in the history
  • Loading branch information
samirelanduk committed Apr 26, 2022
1 parent 801f8e9 commit 41520b0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Molstar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ const Molstar = props => {
const data = await plugin.builders.data.download(
{ url: structureUrl }, {state: {isGhost: true}}
);
const extension = structureUrl.split(".").pop().replace("cif", "mmcif");
let extension = structureUrl.split(".").pop().replace("cif", "mmcif");
if (extension.includes("?"))
extension = extension.substring(0, extension.indexOf("?"));
const traj = await plugin.builders.structure.parseTrajectory(data, extension);
await plugin.builders.structure.hierarchy.applyPreset(traj, "default");
}
Expand Down

0 comments on commit 41520b0

Please sign in to comment.