fix: convert payment_enabled_types array→string before Object.assign to prevent .split() crash

This commit is contained in:
erio
2026-04-07 02:26:35 +08:00
parent 627d15f79c
commit 49c683de62
2 changed files with 4 additions and 5 deletions
+1 -1
View File
@@ -1 +1 @@
0.1.108.53
0.1.108.54
+3 -4
View File
@@ -2338,6 +2338,9 @@ async function loadSettings() {
loadFailed.value = false
try {
const settings = await adminAPI.settings.getSettings()
// Convert array fields before Object.assign to avoid reactive .split() crash
;(settings as any).payment_enabled_types = (settings.payment_enabled_types || []).join(',')
;(settings as any).payment_load_balance_strategy = settings.payment_load_balance_strategy || 'round-robin'
Object.assign(form, settings)
form.backend_mode_enabled = settings.backend_mode_enabled
form.default_subscriptions = Array.isArray(settings.default_subscriptions)
@@ -2356,10 +2359,6 @@ async function loadSettings() {
smtpPasswordManuallyEdited.value = false
form.turnstile_secret_key = ''
form.linuxdo_connect_client_secret = ''
// Payment config is now part of settings response — just fix array→string
form.payment_enabled_types = (settings.payment_enabled_types || []).join(',')
form.payment_load_balance_strategy = settings.payment_load_balance_strategy || 'round-robin'
} catch (error: any) {
loadFailed.value = true
appStore.showError(