Skip to content

Commit 60b75de

Browse files
authored
Merge pull request #129 from Cooper-X-Oak/codex/fix-volcengine-seedasr-resource
fix(asr): 适配火山 2.0 资源 ID 并稳定保存凭据
2 parents 27a954e + f14811c commit 60b75de

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

openless-all/app/src-tauri/src/asr/volcengine.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ pub struct VolcengineCredentials {
4040

4141
impl VolcengineCredentials {
4242
pub fn default_resource_id() -> &'static str {
43-
"volc.bigasr.sauc.duration"
43+
"volc.seedasr.sauc.duration"
4444
}
4545
}
4646

@@ -719,7 +719,7 @@ mod tests {
719719
fn default_resource_id_is_sauc_duration() {
720720
assert_eq!(
721721
VolcengineCredentials::default_resource_id(),
722-
"volc.bigasr.sauc.duration"
722+
"volc.seedasr.sauc.duration"
723723
);
724724
}
725725

openless-all/app/src/pages/Settings.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ const LLM_PRESETS = [
272272

273273
type LlmPresetId = typeof LLM_PRESETS[number]['id'];
274274

275-
const ASR_DEFAULT_RESOURCE_ID = 'volc.bigasr.sauc.duration';
275+
const ASR_DEFAULT_RESOURCE_ID = 'volc.seedasr.sauc.duration';
276276

277277
// SiliconFlow ASR 暂未在后端实现(coordinator.rs 只路由 whisper / volcengine)。
278278
// 在后端接入前不暴露给用户,避免选了之后必然失败。重新启用见 issue #58 的 follow-up。
@@ -569,8 +569,8 @@ function CredentialField({ label, account, placeholder, mono, mask, defaultValue
569569
statusRef.current = window.setTimeout(() => setStatus('idle'), 1600);
570570
};
571571

572-
const save = async (v: string) => {
573-
if (!loaded || !dirty) return;
572+
const save = async (v: string, force = false) => {
573+
if (!loaded || (!dirty && !force)) return;
574574
setStatus('saving');
575575
try {
576576
await setCredential(account, v);
@@ -588,7 +588,7 @@ function CredentialField({ label, account, placeholder, mono, mask, defaultValue
588588
if (!loaded) return;
589589
setDirty(true);
590590
if (debounceRef.current) clearTimeout(debounceRef.current);
591-
debounceRef.current = setTimeout(() => save(v), 300);
591+
debounceRef.current = setTimeout(() => save(v, true), 300);
592592
};
593593

594594
const onBlur = () => {
@@ -597,14 +597,14 @@ function CredentialField({ label, account, placeholder, mono, mask, defaultValue
597597
clearTimeout(debounceRef.current);
598598
debounceRef.current = null;
599599
}
600-
save(value);
600+
save(value, true);
601601
};
602602

603603
const fillDefault = async () => {
604604
if (!loaded || !defaultValue) return;
605605
setValue(defaultValue);
606606
setDirty(true);
607-
await save(defaultValue);
607+
await save(defaultValue, true);
608608
};
609609

610610
const onCopy = async () => {

0 commit comments

Comments
 (0)