refactor: Update lowLevelAccess check in importCharacterCardSpec
This commit is contained in:
@@ -630,8 +630,8 @@ export const languageEnglish = {
|
|||||||
error: "Error",
|
error: "Error",
|
||||||
input: "Input",
|
input: "Input",
|
||||||
select: "Select",
|
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?",
|
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.",
|
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",
|
truthy: "Truthy",
|
||||||
extractRegex: "Extract Text with Regex",
|
extractRegex: "Extract Text with Regex",
|
||||||
runImgGen: "Run Image Generation",
|
runImgGen: "Run Image Generation",
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { language } from "src/lang"
|
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 { DataBase, setDatabase, type customscript, type loreBook, type triggerscript } from "../storage/database"
|
||||||
import { downloadFile } from "../storage/globalApi"
|
import { downloadFile } from "../storage/globalApi"
|
||||||
import { get } from "svelte/store"
|
import { get } from "svelte/store"
|
||||||
@@ -45,6 +45,13 @@ export async function importModule(){
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
importData.id = v4()
|
importData.id = v4()
|
||||||
|
|
||||||
|
if(importData.lowLevelAccess){
|
||||||
|
const conf = await alertConfirm(language.lowLevelAccessConfirm)
|
||||||
|
if(!conf){
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
db.modules.push(importData)
|
db.modules.push(importData)
|
||||||
setDatabase(db)
|
setDatabase(db)
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user