From a061a758f438ef83d56a545bda035816611099b7 Mon Sep 17 00:00:00 2001 From: IanShaw027 Date: Fri, 7 Aug 2026 16:10:31 +0800 Subject: [PATCH] =?UTF-8?q?fix(grok):=20=E4=BF=AE=E5=A4=8D=E8=B0=83?= =?UTF-8?q?=E5=BA=A6=E9=98=88=E5=80=BC=E5=88=9D=E5=A7=8B=E5=8C=96=E4=B8=8E?= =?UTF-8?q?=E5=88=B7=E6=96=B0=E6=B5=8B=E8=AF=95=E5=9B=9E=E5=BD=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/grok_oauth_reconciliation_test.go | 18 ++++++++++++++++++ .../components/account/EditAccountModal.vue | 16 +++++++++------- 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/backend/internal/service/grok_oauth_reconciliation_test.go b/backend/internal/service/grok_oauth_reconciliation_test.go index 8de04a1b5d..5449716447 100644 --- a/backend/internal/service/grok_oauth_reconciliation_test.go +++ b/backend/internal/service/grok_oauth_reconciliation_test.go @@ -107,6 +107,24 @@ func (r *grokReconcileRepo) UpdateCredentials(_ context.Context, id int64, crede return nil } +func (r *grokReconcileRepo) UpdateExtra(_ context.Context, id int64, updates map[string]any) error { + r.mu.Lock() + defer r.mu.Unlock() + for i := range r.accounts { + if r.accounts[i].ID != id { + continue + } + if r.accounts[i].Extra == nil { + r.accounts[i].Extra = make(map[string]any) + } + for key, value := range updates { + r.accounts[i].Extra[key] = value + } + break + } + return nil +} + func (r *grokReconcileRepo) SetError(_ context.Context, id int64, message string) error { r.mu.Lock() defer r.mu.Unlock() diff --git a/frontend/src/components/account/EditAccountModal.vue b/frontend/src/components/account/EditAccountModal.vue index e2729c238a..3bff385cd5 100644 --- a/frontend/src/components/account/EditAccountModal.vue +++ b/frontend/src/components/account/EditAccountModal.vue @@ -3916,10 +3916,11 @@ const applyTempUnschedConfig = (credentials: Record) => { } -const supportsAccountSchedulingThresholdOverridePlatform = (platform: Account['platform'] | undefined) => - platform === 'openai' || platform === 'anthropic' || platform === 'grok' +function supportsAccountSchedulingThresholdOverridePlatform(platform: Account['platform'] | undefined) { + return platform === 'openai' || platform === 'anthropic' || platform === 'grok' +} -const normalizeAccountSchedulingThresholdOverride = (value: unknown): number | null => { +function normalizeAccountSchedulingThresholdOverride(value: unknown): number | null { if (value === null || value === undefined || value === '') { return null } @@ -3934,13 +3935,14 @@ const normalizeAccountSchedulingThresholdOverride = (value: unknown): number | n return integer } -const clampAccountSchedulingThresholdOverride = (value: unknown): number => - Math.min(100, Math.max(1, Math.trunc(Number(value) || 100))) +function clampAccountSchedulingThresholdOverride(value: unknown): number { + return Math.min(100, Math.max(1, Math.trunc(Number(value) || 100))) +} -const loadAccountSchedulingThresholdOverride = ( +function loadAccountSchedulingThresholdOverride( platform: Account['platform'] | undefined, credentials: Record | undefined -) => { +) { if (!supportsAccountSchedulingThresholdOverridePlatform(platform)) { accountSchedulingThresholdOverrideEnabled.value = false accountSchedulingThresholdOverrideValue.value = 100