Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion gonotego/settings-server/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,29 @@ const SettingsUI = () => {
const handleSave = async () => {
setSaveStatus('saving');
try {
// Create an object with only the changed settings
const changedSettings = {};

// Compare each setting with its original value
for (const [key, value] of Object.entries(settings)) {
// Get the original value
const originalValue = originalSettings[key];

// Check if this setting has changed using string comparison
// This handles all types of settings including arrays (via JSON.stringify)
if (JSON.stringify(value) !== JSON.stringify(originalValue)) {
changedSettings[key] = value;
}
}

console.log('Sending only changed settings:', changedSettings);

const response = await fetch('/api/settings', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(settings),
body: JSON.stringify(changedSettings),
});

if (!response.ok) {
Expand Down