refactor: Update lowLevelAccess check in importCharacterCardSpec

This commit is contained in:
kwaroran
2024-05-29 18:34:57 +09:00
parent f1777aba2c
commit 2870fb2238
2 changed files with 10 additions and 3 deletions

View File

@@ -630,8 +630,8 @@ export const languageEnglish = {
error: "Error",
input: "Input",
select: "Select",
lowLevelAccessConfirm: "This character uses Low Level Access. which means this character can access the AI model and your storage directly. do you really want to import this character?",
triggerLowLevelOnly: "This trigger only works with Low Level Access. to enable this trigger, enable Low Level Access in advanced settings in the character.",
lowLevelAccessConfirm: "This content uses Low Level Access. which means this content can access the AI model and your storage directly. do you really want to import this content?",
triggerLowLevelOnly: "This trigger only works with Low Level Access. to enable this trigger, enable Low Level Access in advanced settings in the character or module.",
truthy: "Truthy",
extractRegex: "Extract Text with Regex",
runImgGen: "Run Image Generation",

View File

@@ -1,5 +1,5 @@
import { language } from "src/lang"
import { alertError, alertNormal } from "../alert"
import { alertConfirm, alertError, alertNormal } from "../alert"
import { DataBase, setDatabase, type customscript, type loreBook, type triggerscript } from "../storage/database"
import { downloadFile } from "../storage/globalApi"
import { get } from "svelte/store"
@@ -45,6 +45,13 @@ export async function importModule(){
return
}
importData.id = v4()
if(importData.lowLevelAccess){
const conf = await alertConfirm(language.lowLevelAccessConfirm)
if(!conf){
return false
}
}
db.modules.push(importData)
setDatabase(db)
return