From 3ef3e1674f1e4f69dcbd120b04f7e200298fce8f Mon Sep 17 00:00:00 2001 From: vipinpaul Date: Wed, 13 Nov 2024 14:44:35 +0530 Subject: [PATCH] Fixed the issues with importing USFM and auto deleting the selected scope --- renderer/src/core/burrito/createAudioSB.js | 2 +- renderer/src/core/projects/saveProjetcsMeta.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/renderer/src/core/burrito/createAudioSB.js b/renderer/src/core/burrito/createAudioSB.js index c7012a8d..67777f19 100644 --- a/renderer/src/core/burrito/createAudioSB.js +++ b/renderer/src/core/burrito/createAudioSB.js @@ -57,7 +57,7 @@ const createAudioSB = ( json.copyright.licenses[0].ingredient = 'license.md'; } selectedScope.forEach((scope) => { - json.type.flavorType.currentScope[scope] = []; + json.type.flavorType.currentScope[scope] = json.type.flavorType.currentScope[scope] || []; localizedNames[scope] = json.localizedNames[scope]; }); json.localizedNames = localizedNames; diff --git a/renderer/src/core/projects/saveProjetcsMeta.js b/renderer/src/core/projects/saveProjetcsMeta.js index bd308377..5c74c53d 100644 --- a/renderer/src/core/projects/saveProjetcsMeta.js +++ b/renderer/src/core/projects/saveProjetcsMeta.js @@ -179,7 +179,7 @@ export const saveProjectsMeta = async (projectMetaObj) => { ), JSON.stringify(burritoFile)); // then maybe make a SB usfm - if (type === 'audio') { + if (type === 'Audio') { // Adding text USFM to audio project if ((projectMetaObj.importedFiles).length !== 0) { const newScope = []; @@ -229,6 +229,7 @@ export const saveProjectsMeta = async (projectMetaObj) => { await fs.writeFileSync(path.join( projectDir, `${projectMetaObj.newProjectFields.projectName}_${id}`, + 'text-1', 'metadata.json', ), JSON.stringify(burrito)); });