Skip to content

Commit

Permalink
Merge pull request ourongxing#103 from GOWxx/chore_modify_defaultSetting
Browse files Browse the repository at this point in the history
chore: modify defaultSetting object in main.js
  • Loading branch information
ourongxing authored Mar 21, 2023
2 parents b7ee581 + 2a6d735 commit d871744
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,16 @@ import { parsePrompts } from "~/utils/parse"
import { setting, message, resetContinuousDialogue } from "~/system"
const prompts = parsePrompts()
const defaultMessage = import.meta.env.DEFAULT_MESSAGE || message
let defaultSetting
try {
defaultSetting = JSON.parse(import.meta.env.DEFAULT_SETTING)
} catch {
defaultSetting = setting
let defaultSetting = setting
if (import.meta.env.DEFAULT_SETTING) {
try {
defaultSetting = {
...setting,
...JSON.parse(import.meta.env.DEFAULT_SETTING)
}
} catch (e) {
console.error("Error parsing DEFAULT_SETTING:", e)
}
}
const _reset = import.meta.env.RESET_CONTINUOUS_DIALOGUE_OPTION
Expand Down

0 comments on commit d871744

Please sign in to comment.