From 8cad607d98303a4a5cf46b875cbb3d797feaeeaa Mon Sep 17 00:00:00 2001 From: Chuck <33324927+ChuckBuilds@users.noreply.github.com> Date: Sun, 21 Sep 2025 21:12:38 -0400 Subject: [PATCH] Fix display settings save error by adding missing config_type parameter (#58) - Added config_type='main' to FormData when submitting display form - Added proper HTTP error handling to catch non-JSON responses - This fixes the 'Unexpected token <' JSON parsing error when saving display settings --- templates/index_v2.html | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/templates/index_v2.html b/templates/index_v2.html index cf1df649..65a88c59 100644 --- a/templates/index_v2.html +++ b/templates/index_v2.html @@ -2764,12 +2764,18 @@ document.getElementById('display-form').addEventListener('submit', async function(e) { e.preventDefault(); const formData = new FormData(this); + formData.append('config_type', 'main'); try { const response = await fetch('/save_config', { method: 'POST', body: formData }); + + if (!response.ok) { + throw new Error(`HTTP ${response.status}: ${response.statusText}`); + } + const result = await response.json(); showNotification(result.message, result.status); } catch (error) {