Skip to content

Conversation

@melange396
Copy link
Contributor

@melange396 melange396 commented Mar 5, 2025

This swaps the evaluation order of the blocks for the svelte stores (and session/local storage) of 'api-key' and 'store-api-key'. Also updates some comments a little.

Each of the stores' .subscribe() event handlers are called immediately after registration (w/ the initial value as an argument). Because of that, prior to this PR, the "store api key flag" was processed before the "api key" was retrieved from persistent storage, thereby overwriting a previously saved api key with an empty value. Now, a pre-existing api key is loaded before any attempt to save it back to persistent storage.

@melange396 melange396 changed the title attempt to fix API key persistence fix API key persistence Mar 5, 2025
@melange396 melange396 requested a review from dmytrotsko March 5, 2025 08:28
@melange396 melange396 linked an issue Mar 5, 2025 that may be closed by this pull request
Copy link

@dmytrotsko dmytrotsko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@melange396 melange396 merged commit 485d4dc into dev Mar 5, 2025
6 checks passed
@melange396 melange396 deleted the persistent_api_key_fix branch March 5, 2025 17:14
This was referenced Mar 5, 2025
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.

BUG: API key persistence between sessions is broken

3 participants