Skip to content

Commit

Permalink
Only sanitize words once when adding
Browse files Browse the repository at this point in the history
  • Loading branch information
richardfrost committed Sep 9, 2018
1 parent e334c9a commit b36f0c4
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 4 deletions.
1 change: 0 additions & 1 deletion dist/eventPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ chrome.runtime.onMessage.addListener(function (request, sender, sendResponse) {
// Add selected word/phrase and reload page (unless already present)
function addSelection(selection) {
return __awaiter(this, void 0, void 0, function* () {
selection = (selection.trim()).toLowerCase();
let cfg = yield WebConfig.build(); // TODO: Only need words here
let result = cfg.addWord(selection);
if (result) {
Expand Down
2 changes: 1 addition & 1 deletion dist/optionPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ export default class OptionPage {
}
wordAdd(event) {
let wordText = document.getElementById('wordText');
let word = wordText.value.trim().toLowerCase();
let word = wordText.value;
let result = this.cfg.addWord(word);
if (word != '') {
if (result) {
Expand Down
1 change: 0 additions & 1 deletion src/eventPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ chrome.runtime.onMessage.addListener(
//
// Add selected word/phrase and reload page (unless already present)
async function addSelection(selection: string) {
selection = (selection.trim()).toLowerCase();
let cfg = await WebConfig.build(); // TODO: Only need words here
let result = cfg.addWord(selection);

Expand Down
2 changes: 1 addition & 1 deletion src/optionPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ export default class OptionPage {

wordAdd(event) {
let wordText = document.getElementById('wordText') as HTMLInputElement;
let word = wordText.value.trim().toLowerCase();
let word = wordText.value;
let result = this.cfg.addWord(word);

if (word != '') {
Expand Down

0 comments on commit b36f0c4

Please sign in to comment.