Refactor importModule function to set default values for name and description
This commit is contained in:
@@ -51,8 +51,8 @@ export async function importModule(){
|
|||||||
if(importData.type === 'risu' && importData.data){
|
if(importData.type === 'risu' && importData.data){
|
||||||
const lores:loreBook[] = importData.data
|
const lores:loreBook[] = importData.data
|
||||||
const importModule = {
|
const importModule = {
|
||||||
name: importData.name,
|
name: importData.name || 'Imported Lorebook',
|
||||||
description: importData.description,
|
description: importData.description || 'Converted from risu lorebook',
|
||||||
lorebook: lores,
|
lorebook: lores,
|
||||||
id: v4()
|
id: v4()
|
||||||
}
|
}
|
||||||
@@ -63,8 +63,8 @@ export async function importModule(){
|
|||||||
if(importData.entries){
|
if(importData.entries){
|
||||||
const lores:loreBook[] = convertExternalLorebook(importData.entries)
|
const lores:loreBook[] = convertExternalLorebook(importData.entries)
|
||||||
const importModule = {
|
const importModule = {
|
||||||
name: importData.name,
|
name: importData.name || 'Imported Lorebook',
|
||||||
description: importData.description,
|
description: importData.description || 'Converted from external lorebook',
|
||||||
lorebook: lores,
|
lorebook: lores,
|
||||||
id: v4()
|
id: v4()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user