Fix moduleIds concatenation in getModuleLorebooks, getModuleTriggers, and getModuleRegexScripts functions

This commit is contained in:
kwaroran
2024-02-07 02:55:12 +09:00
parent ad443b3bcb
commit 2b223b2704

View File

@@ -65,8 +65,8 @@ export function getModuleLorebooks() {
const currentChat = get(CurrentChat)
const db = get(DataBase)
if (!currentChat) return []
const moduleIds = currentChat.modules ?? []
moduleIds.concat(db.enabledModules)
let moduleIds = currentChat.modules ?? []
moduleIds = moduleIds.concat(db.enabledModules)
let lorebooks: loreBook[] = []
for (const moduleId of moduleIds) {
const module = getModuleById(moduleId)
@@ -85,8 +85,8 @@ export function getModuleTriggers() {
const currentChat = get(CurrentChat)
const db = get(DataBase)
if (!currentChat) return []
const moduleIds = currentChat.modules ?? []
moduleIds.concat(db.enabledModules)
let moduleIds = currentChat.modules ?? []
moduleIds = moduleIds.concat(db.enabledModules)
let triggers: triggerscript[] = []
for (const moduleId of moduleIds) {
const module = getModuleById(moduleId)
@@ -104,8 +104,8 @@ export function getModuleRegexScripts() {
const currentChat = get(CurrentChat)
const db = get(DataBase)
if (!currentChat) return []
const moduleIds = currentChat.modules ?? []
moduleIds.concat(db.enabledModules)
let moduleIds = currentChat.modules ?? []
moduleIds = moduleIds.concat(db.enabledModules)
let customscripts: customscript[] = []
for (const moduleId of moduleIds) {
const module = getModuleById(moduleId)