Skip to content

fix: take into account all changed keys #210

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

SantosVilanculos
Copy link

Fix: Account for all changed keys in settingsStore.onDidAnyChange

This commit addresses an issue where only the first changed key was being processed when multiple settings were updated simultaneously. The previous implementation used Object.keys(newValue).find() which stops after finding the first difference.

The updated code now iterates through all keys in the newValue object and compares them to their corresponding values in oldValue. This ensures that every changed setting triggers the notifyLaravel function, providing a complete and accurate representation of settings modifications.

Specifically, this change is crucial in scenarios where:

  • clear() or reset() are called on the settings store.
  • Multiple settings are updated within a single operation.
  • The application is running in watch mode, where consistent updates are expected.

The Object.keys(newValue).filter() method now obtains all changed keys, which are each sent to the notifyLaravel to update the backend for each relevant setting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant