Skip to content

Commit

Permalink
Merge branch 'main' into css-touchup
Browse files Browse the repository at this point in the history
  • Loading branch information
danielfang97 authored Sep 18, 2024
2 parents aa27c7e + 92f2f36 commit 5d08e69
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
"title": "Component",
"stripAfter": "#",
"predicates": [
"sbol:Component"
],
"link": "$<componentLink>"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,19 @@ export default function AttachmentRows(properties) {
const dispatch = useDispatch();
const token = useSelector(state => state.user.token);
const [attachmentInfo, setStateAttachments] = useState();
const [attachments, setAttachments] = useState(properties.attachments.map(attachment => ({

const [attachments, setAttachments] = useState((properties.attachments || []).map(attachment => ({
...attachment,
processedTopLevel: attachment.topLevel // Initialize with topLevel
})));


//There are attachments from the parent but they haven't been added to the state yet.
if (attachmentInfo === undefined && properties.attachments.length > 0)
if (attachmentInfo === undefined && properties.attachments && properties.attachments.length > 0)
setStateAttachments(properties.attachments);

//There are no attachments to get.
if (properties.attachments.length === 0) return null;
if (properties.attachments && properties.attachments.length === 0) return null;

// useEffect(() => {
// async function processAttachments() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import styles from '../../../../styles/view.module.css';
*/
export default function AttachmentsTable(properties) {
const header = createHeader(properties.headers);

if (properties.attachments.length === 0 && !properties.owner) return null;
console.log(properties);
if (properties.attachments && properties.attachments.length === 0 && !properties.owner) return null;

return (
<table className={styles.table}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ export default function UploadAttachments(properties) {
//Query all the attachments so the store can be updated.
getQueryResponse(dispatch, getAttachments, {
uri: properties.uri
}).then(allAttachments => {
}, token).then(allAttachments => {
dispatch(setAttachments(allAttachments));
});
});
Expand Down
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"scripts": {
"dev": "NODE_OPTIONS=--openssl-legacy-provider node customDev.js",
"windowsdev": "node customDev.js",
"dev1": "node customDev.js",
"build": "next build",
"start": "next start -p 3333",
"lint": "eslint '*/**/*.{js,jsx}'",
Expand Down
2 changes: 1 addition & 1 deletion frontend/public/commitHash.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18bc537fa82c0fafdfb178601ba7d61d19c0fe9b
c8d687e1e2b0a24ec2e3164ca6250a256f9ea980

0 comments on commit 5d08e69

Please sign in to comment.