Skip to content

Commit

Permalink
refactor: Reduce unnecessary function calls
Browse files Browse the repository at this point in the history
  • Loading branch information
DanSM-5 committed Oct 20, 2023
1 parent ce787c6 commit ff36766
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions options/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
profileFunction = 'createProfile';
}

const id = targetProfile.dataset.id || uuid();
const id = targetProfile.dataset.id;
const profile = { id, name, content };

backgroundPage[profileFunction](profile);
Expand Down Expand Up @@ -102,8 +102,7 @@
profileDiv.classList.add('profile');
buttonsWrapper.classList.add('buttons-wrapper');
saveButton.classList.add('button');
deleteButton.classList.add('button');
deleteButton.classList.add('delete-button');
deleteButton.classList.add('button', 'delete-button');

profileName.placeholder = 'Profile Name';
profileContent.placeholder = 'mpv args (1 per line)';
Expand All @@ -117,12 +116,8 @@
saveButton.textContent = 'save';
deleteButton.textContent = 'delete';

buttonsWrapper.appendChild(saveButton);
buttonsWrapper.appendChild(deleteButton);

profileDiv.appendChild(profileName);
profileDiv.appendChild(profileContent);
profileDiv.appendChild(buttonsWrapper);
buttonsWrapper.append(saveButton, deleteButton);
profileDiv.append(profileName, profileContent, buttonsWrapper);

return profileDiv;
}
Expand Down

0 comments on commit ff36766

Please sign in to comment.