From 389ee7917f048f31bc90d531ca6ef44d10532db3 Mon Sep 17 00:00:00 2001 From: sirius422 Date: Fri, 26 Apr 2024 23:07:25 +0800 Subject: [PATCH] Add json extension to exported oai and LogitBias presets --- public/scripts/openai.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/public/scripts/openai.js b/public/scripts/openai.js index 10b15326d..87eba767e 100644 --- a/public/scripts/openai.js +++ b/public/scripts/openai.js @@ -3250,7 +3250,8 @@ async function onExportPresetClick() { delete preset.proxy_password; const presetJsonString = JSON.stringify(preset, null, 4); - download(presetJsonString, oai_settings.preset_settings_openai, 'application/json'); + const presetFileName = `${oai_settings.preset_settings_openai}.json`; + download(presetJsonString, presetFileName, 'application/json'); } async function onLogitBiasPresetImportFileChange(e) { @@ -3298,7 +3299,8 @@ function onLogitBiasPresetExportClick() { } const presetJsonString = JSON.stringify(oai_settings.bias_presets[oai_settings.bias_preset_selected], null, 4); - download(presetJsonString, oai_settings.bias_preset_selected, 'application/json'); + const presetFileName = `${oai_settings.bias_preset_selected}.json`; + download(presetJsonString, presetFileName, 'application/json'); } async function onDeletePresetClick() {