Skip to content
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

bugfix/out-of-sync-data-source #416

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

Conversation

BrianWhitneyAI
Copy link
Contributor

@BrianWhitneyAI BrianWhitneyAI commented Feb 7, 2025

Description

The purpose of this PR is to resolve #398 and centralize the data source variable in the main process so that the "Data Source" menu always reflects the current state, allows users to change it, and persists those changes across app restarts, refreshes and cache clears.

Changes

  • Added an envManager.ts module that loads the persisted environment on startup and updates it (persisting the new value and rebuilding the menu).

  • Changed the Data Source menu to be built dynamically (via a function) so that its radio buttons always reflect the current environment.

  • Modified the menu click to call updateEnvironment() (which updates state and rebuilds the menu) and send an event. The main process loads the environment before building the menu, and the renderer listens for updates to re‑render the UI.

Testing

  1. Open app and select staging
  2. Refresh / Reload / Clear Cache
  3. Check that correct data source is selected and matches data
  4. repeat and iterate for different env / data sources

@BrianWhitneyAI BrianWhitneyAI marked this pull request as ready for review February 7, 2025 20:58
@BrianWhitneyAI
Copy link
Contributor Author

Something funky, github doesn't seem to be tracking indent changes. I tried to adhere to 4 space indents but may have missed some.

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.

Selected data source does not match actual data source
2 participants