Skip to content

added toggle migration code#60

Open
dflippojr wants to merge 1 commit intomasterfrom
toggleMigration
Open

added toggle migration code#60
dflippojr wants to merge 1 commit intomasterfrom
toggleMigration

Conversation

@dflippojr
Copy link
Collaborator

No description provided.

@dflippojr dflippojr changed the title added migration code added toggle migration code Aug 17, 2023
for (const highlighterIndex of currentOptions.highlighter) {
for (const attributeName of Object.keys(defaultOptions.highlighter)) {
if (!(attributeName in currentOptions.highlighter[highlighterIndex])) {
chrome.storage.local.set({ highlighter: defaultOptions.highlighter });
Copy link
Owner

Choose a reason for hiding this comment

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

we only want to change the specific attribute that's new, not ALL attributes to the default

Copy link
Owner

Choose a reason for hiding this comment

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

const newHighlighter = []
 for (const highlighterIndex of currentOptions.highlighter) {
     const newHighlighterItem = currentOptions.highlighter[highlighterIndex]
        for (const attributeName of Object.keys(defaultOptions.highlighter)) {
          if (!(attributeName in currentOptions.highlighter[highlighterIndex])) {
             newHighlighterItem[attributeName] = defaultOptions.highlighter[attributeName]
         }
     }
   append
 }
 set
 

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.

2 participants

Comments