Skip to content

Commit

Permalink
fix: ad-hoc visualization state becomes inconsistent after toggling e…
Browse files Browse the repository at this point in the history
…xtension off and on (#7433)

#### Details

This PR adjusts the logic for setting extension initial state so that
the toggles are always off (reflecting reality because the
visualizations will never be active on extension start).

##### Motivation

Addresses #6256

##### Context


#### Pull request checklist
<!-- If a checklist item is not applicable to this change, write "n/a"
in the checkbox -->
- [x] Addresses an existing issue: #6256
- [x] Ran `yarn fastpass`
- [x] Added/updated relevant unit test(s) (and ran `yarn test`)
- [x] Verified code coverage for the changes made. Check coverage report
at: `<rootDir>/test-results/unit/coverage`
- [x] PR title *AND* final merge commit title both start with a semantic
tag (`fix:`, `chore:`, `feat(feature-name):`, `refactor:`). See
`CONTRIBUTING.md`.

Co-authored-by: Madalyn Parker <[email protected]>
  • Loading branch information
madalynrose and Madalyn Parker authored Sep 4, 2024
1 parent 9c0dafa commit af8b586
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/background/initial-visualization-store-data-generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,10 @@ export class InitialVisualizationStoreDataGenerator {
};

const initialState = !isEmpty(persistedData)
? merge({}, defaultValues, persistedData)
? merge({}, defaultValues, persistedData, {
tests: { adhoc: defaultValues.tests.adhoc },
})
: defaultValues;

return initialState;
}

Expand Down

0 comments on commit af8b586

Please sign in to comment.