Skip to content

Commit

Permalink
fix capital letter in activation phrase - ms
Browse files Browse the repository at this point in the history
  • Loading branch information
mlsof21 committed Oct 4, 2022
1 parent 19b8119 commit 1f4aeeb
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 20 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### 1.2.2 - 2022-10-04 - Activation Phrase Fix

- Added fix for capital letter in activation phrase by trimming/lowercasing everywhere

### 1.2.1 - 2022-10-03 - Only in Inventory

- Added fix for loading DIM on another tab. Previously required reloading the page on the inventory tab. Now Voice DIM will load no matter what page is started on
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "voice-dim",
"version": "1.2.1",
"version": "1.2.2",
"description": "Perform common DIM actions by using speech recognition.",
"main": "dist/chrome/js/voice-dim.js",
"scripts": {
Expand Down
33 changes: 24 additions & 9 deletions public/manifest.chrome.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
{
"name": "Voice DIM",
"description": "Control DIM with your voice.",
"version": "1.2.1",
"version": "1.2.2",
"manifest_version": 3,
"background": {
"service_worker": "js/background.js"
},
"content_scripts": [
{
"matches": ["https://*.destinyitemmanager.com/*"],
"js": ["js/voiceDim.js"],
"css": ["css/voiceDim.css"]
"matches": [
"https://*.destinyitemmanager.com/*"
],
"js": [
"js/voiceDim.js"
],
"css": [
"css/voiceDim.css"
]
}
],
"commands": {
Expand All @@ -36,12 +42,21 @@
"page": "html/options.html",
"open_in_tab": true
},
"host_permissions": ["https://www.bungie.net/*"],
"permissions": ["tabs", "storage"],
"host_permissions": [
"https://www.bungie.net/*"
],
"permissions": [
"tabs",
"storage"
],
"web_accessible_resources": [
{
"resources": ["icons/icon_large.png"],
"matches": ["https://*.destinyitemmanager.com/*"]
"resources": [
"icons/icon_large.png"
],
"matches": [
"https://*.destinyitemmanager.com/*"
]
}
]
}
}
24 changes: 17 additions & 7 deletions public/manifest.firefox.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
{
"name": "Voice DIM",
"description": "Control DIM with your voice.",
"version": "1.2.1",
"version": "1.2.2",
"manifest_version": 2,
"background": {
"scripts": ["js/background.js"]
"scripts": [
"js/background.js"
]
},
"content_scripts": [
{
"matches": ["https://*.destinyitemmanager.com/*"],
"js": ["js/voiceDim.js"],
"css": ["css/voiceDim.css"]
"matches": [
"https://*.destinyitemmanager.com/*"
],
"js": [
"js/voiceDim.js"
],
"css": [
"css/voiceDim.css"
]
}
],
"commands": {
Expand Down Expand Up @@ -42,5 +50,7 @@
"https://www.bungie.net/common/**",
"https://api.speechly.com/**"
],
"web_accessible_resources": ["icons/icon_large.png"]
}
"web_accessible_resources": [
"icons/icon_large.png"
]
}
4 changes: 2 additions & 2 deletions src/ts/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function onActivationPhraseChange() {

store<AlwaysListening>('alwaysListening', {
active: listeningToggle.checked,
activationPhrase: activationPhrase.value,
activationPhrase: activationPhrase.value.trim().toLowerCase(),
});
sendListenOptionsMessage();
}
Expand All @@ -61,7 +61,7 @@ function onAlwaysListeningChange(listeningOptions: AlwaysListening) {

store<AlwaysListening>('alwaysListening', {
active: listeningOptions.active,
activationPhrase: listeningOptions.activationPhrase,
activationPhrase: listeningOptions.activationPhrase.trim().toLowerCase(),
});
sendListenOptionsMessage();
}
Expand Down
2 changes: 1 addition & 1 deletion src/ts/voiceDim.ts
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ function initializeAlwaysListening() {
let actionPerformed = false;
for (let said of userSaid) {
said = said.trim().toLowerCase();
const ap = listeningOptions.activationPhrase;
const ap = listeningOptions.activationPhrase.trim().toLowerCase();
const phrases = [ap];

if (ap.includes('dim')) phrases.push(ap.replace('dim', 'them'));
Expand Down

0 comments on commit 1f4aeeb

Please sign in to comment.