Refactor importModule function to set default values for name and description

This commit is contained in:
kwaroran
2024-02-07 06:22:33 +09:00
parent 87bfdb5140
commit 1e900d44ac

View File

@@ -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()
}