Skip to content

Commit 02bdeca

Browse files
committed
Fixed blanks in file lists in nodeDetails
1 parent 99f6ac2 commit 02bdeca

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

src/component/modals/NodeDetails.jsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ const NodeDetails = ({
1313
const [widthSet] = useState(false);
1414
const [labelName, setLabelName] = useState('');
1515
const [labelFile, setLabelFile] = useState('');
16+
const indexOfFile = [];
17+
indexOfFile.push(0);
1618

1719
const setStyle = (prop) => {
1820
setData({ ...data, style: { ...data.style, ...prop } });
@@ -117,14 +119,17 @@ const NodeDetails = ({
117119
{
118120
localStorageManager.getFileList()
119121
// eslint-disable-next-line max-len, prefer-arrow-callback
120-
? JSON.parse(localStorageManager.getFileList()).map(function fn(item, index) {
122+
? JSON.parse(localStorageManager.getFileList()).map(function fn(item) {
121123
const acceptedTypes = ['.v', '.c', '.cpp', '.py', '.m', '.sh'];
122124
const list = [];
125+
let index;
123126
// eslint-disable-next-line max-len
124127
if ((acceptedTypes.some((substring) => item.key.toString().includes(substring)))) {
125128
list.push(item.key.toString());
129+
indexOfFile.push(indexOfFile[indexOfFile.length - 1] + 1);
130+
index = indexOfFile[indexOfFile.length - 1] + 1;
126131
}
127-
// eslint-disable-next-line jsx-a11y/control-has-associated-label, react/no-array-index-key
132+
// eslint-disable-next-line jsx-a11y/control-has-associated-label
128133
return <option value={list} key={index} />;
129134
})
130135
: ''

src/graph-builder/graph-core/5-load-save.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,7 @@ class GraphLoadSave extends GraphUndoRedo {
109109

110110
saveToFolder() {
111111
const str = graphmlBuilder(this.jsonifyGraph());
112-
const bytes = new TextEncoder().encode(str);
113-
const blob = new Blob([bytes], { type: 'application/json;charset=utf-8' });
114-
return blob;
112+
return str;
115113
}
116114

117115
getGraphML() {

0 commit comments

Comments
 (0)