From 1e900d44acd51f4efcbcdd05241a79788a5f5ba9 Mon Sep 17 00:00:00 2001 From: kwaroran Date: Wed, 7 Feb 2024 06:22:33 +0900 Subject: [PATCH] Refactor importModule function to set default values for name and description --- src/ts/process/modules.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ts/process/modules.ts b/src/ts/process/modules.ts index 0a83110c..cf7f9d97 100644 --- a/src/ts/process/modules.ts +++ b/src/ts/process/modules.ts @@ -51,8 +51,8 @@ export async function importModule(){ if(importData.type === 'risu' && importData.data){ const lores:loreBook[] = importData.data const importModule = { - name: importData.name, - description: importData.description, + name: importData.name || 'Imported Lorebook', + description: importData.description || 'Converted from risu lorebook', lorebook: lores, id: v4() } @@ -63,8 +63,8 @@ export async function importModule(){ if(importData.entries){ const lores:loreBook[] = convertExternalLorebook(importData.entries) const importModule = { - name: importData.name, - description: importData.description, + name: importData.name || 'Imported Lorebook', + description: importData.description || 'Converted from external lorebook', lorebook: lores, id: v4() }