Skip to content

Commit

Permalink
feat: handle unassigned shortcuts gracefully
Browse files Browse the repository at this point in the history
  • Loading branch information
timbru31 committed Jan 24, 2025
1 parent f84ad90 commit 512c4be
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
6 changes: 5 additions & 1 deletion src/_locales/de/messages.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"version": {
"message": "Quick JIRA v1.0.0",
"message": "Quick JIRA v2.0.0",
"description": "Please do not alter this value"
},
"options": {
Expand Down Expand Up @@ -110,5 +110,9 @@
"placeholder": {
"message": "Gib die Ticket ID ein",
"description": "Placeholder text for the input field"
},
"unassigned": {
"message": "Nicht zugewiesen",
"description": "Text for unassigned shortcut"
}
}
6 changes: 5 additions & 1 deletion src/_locales/en/messages.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"version": {
"message": "Quick JIRA v1.0.0",
"message": "Quick JIRA v2.0.0",
"description": "Please do not alter this value"
},
"options": {
Expand Down Expand Up @@ -110,5 +110,9 @@
"placeholder": {
"message": "Enter ticket ID",
"description": "Placeholder text for the input field"
},
"unassigned": {
"message": "Unassigned",
"description": "Text for unassigned shortcut"
}
}
6 changes: 3 additions & 3 deletions src/js/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,13 @@ const loadShortcuts = async () => {
switch (command.name) {
case '_execute_action':
case '_execute_browser_action':
listItem.textContent = `Popup: ${command.shortcut ?? 'Ctrl+Shift+K'}`;
listItem.textContent = `Popup: ${command.shortcut === '' ? _browser.i18n.getMessage('unassigned') : (command.shortcut ?? 'Ctrl+Shift+K')}`;
break;
case 'open-ticket-in-new-tab':
listItem.textContent = `${_browser.i18n.getMessage('openInNewTab')}: ${command.shortcut ?? 'Alt+Shift+K'}`;
listItem.textContent = `${_browser.i18n.getMessage('openInNewTab')}: ${command.shortcut === '' ? _browser.i18n.getMessage('unassigned') : (command.shortcut ?? 'Alt+Shift+K')}`;
break;
case 'open-ticket-in-current-tab':
listItem.textContent = `${_browser.i18n.getMessage('openInCurrentTab')}: ${command.shortcut ?? 'Alt+K'}`;
listItem.textContent = `${_browser.i18n.getMessage('openInCurrentTab')}: ${command.shortcut === '' ? _browser.i18n.getMessage('unassigned') : (command.shortcut ?? 'Alt+K')}`;
break;
}
shortcutList.appendChild(listItem);
Expand Down

0 comments on commit 512c4be

Please sign in to comment.