Skip to content

Commit b2393c1

Browse files
committed
fix issue with kit import overwriting local file due to file name reference
1 parent d91ce11 commit b2393c1

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/redux/actions.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ export function importKitFromFile() {
7272
}
7373

7474
let {kit, pads} = getKitAndPadsFromFile(result.filePaths[0]);
75+
76+
// remove the filename, as a new one will get created
77+
kit.fileName = null;
78+
7579
dispatch({ type: Actions.ADD_PADS, pads: pads });
7680
dispatch({ type: Actions.ADD_KIT, kit: kit });
7781
dispatch({ type: Actions.SET_SELECTED_KIT_ID, kitId: kit.id });

src/util/storage.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ export const saveKitToFile = (kit, pads, asNew = false) => {
7676
fs.writeSync(fd, buffer, 0, buffer.length);
7777
});
7878

79-
8079
if (currentFileName && desiredFileName !== currentFileName && !asNew) {
8180
// we need to rename the file, too
8281
fs.renameSync(

0 commit comments

Comments
 (0)