shabados / presenter

Desktop app for presenting the Shabad OS Database on projectors, TVs, and live streams
https://shabados.com
MIT License
18 stars 15 forks source link

fix: correct global + local settings behaviour #644

Closed Harjot1Singh closed 3 years ago

Harjot1Singh commented 3 years ago

Summary of PR

The reset button for server/global settings currently do not work. This is because the sent settings always merge with the existing settings, and thus removed properties do not reset, as the existing settings are retained.

This PR modifies this behaviour to prevent automatic merging unless required. Merging always does still happen with default settings. This fixes #472.

Additionally, when global settings are updated, the server attempts to update the sender's settings with an empty object - instead, this behaviour has been replaced with a conditional update to the sender's settings, aka If a actually sender updates their settings, only then will the backend attempt to modify it.

Tests for unexpected behavior

Time spent on PR

2 hours

Linked issues

Fix #472 Fix #449