feat: add return CSS error option and update related functionality

This commit is contained in:
Kwaroran
2025-02-19 11:12:12 +09:00
parent a5d2b4589c
commit 6177957c64
4 changed files with 11 additions and 1 deletions

View File

@@ -1056,4 +1056,5 @@ export const languageEnglish = {
copy: "Copy",
paste: "Paste",
depth: "Depth",
returnCSSError: "Return CSS Error",
}

View File

@@ -196,6 +196,10 @@
<Check bind:check={DBState.db.checkCorruption} name={language.checkCorruption}>
</Check>
</div>
<div class="flex items-center mt-4">
<Check bind:check={DBState.db.returnCSSError} name={language.returnCSSError}>
</Check>
</div>
{#if DBState.db?.account?.useSync}
<div class="flex items-center mt-4">
<Check bind:check={DBState.db.lightningRealmImport} name={"Lightning Realm Import"}>

View File

@@ -644,7 +644,10 @@ function decodeStyle(text:string){
return `<style>${css.stringify(ast)}</style>`
} catch (error) {
return `CSS ERROR: ${error}`;
if(DBState.db.returnCSSError){
return `CSS ERROR: ${error}`
}
return ""
}
})
}

View File

@@ -483,6 +483,7 @@ export function setDatabase(data:Database){
processRegexScript: data.hypaV3Settings?.processRegexScript ?? false,
doNotSummarizeUserMessage: data.hypaV3Settings?.doNotSummarizeUserMessage ?? false
}
data.returnCSSError ??= true
changeLanguage(data.language)
setDatabaseLite(data)
}
@@ -903,6 +904,7 @@ export interface Database{
bulkEnabling:boolean
showTranslationLoading: boolean
showDeprecatedTriggerV1:boolean
returnCSSError:boolean
}
interface SeparateParameters{