Skip to content

Commit

Permalink
Use more meaningful command name internally
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Oct 30, 2023
1 parent 5b49648 commit 31f7d2e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions webextensions/background/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -1027,10 +1027,10 @@ SidebarConnection.onMessage.addListener(async (windowId, message) => {
performTabsDragDropWithMessage(message);
break;

case Constants.kCOMMAND_TOGGLE_MUTED: {
case Constants.kCOMMAND_TOGGLE_MUTED_FROM_SOUND_BUTTON: {
await Tab.waitUntilTracked(message.tabId);
const root = Tab.get(message.tabId);
log('toggle muted state: ', message, root);
log('toggle muted state from sound button: ', message, root);
if (!root)
break;

Expand Down
2 changes: 1 addition & 1 deletion webextensions/common/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export const kCOMMAND_AUTODETECT_DUPLICATED_TAB_DETECTION_DELAY = 'treestyletab:
export const kCOMMAND_TEST_DUPLICATED_TAB_DETECTION = 'treestyletab:test-duplicated-tab-detection';

export const kCOMMAND_ACTIVATE_TAB = 'treestyletab:activate-tab';
export const kCOMMAND_TOGGLE_MUTED = 'treestyletab:toggle-muted';
export const kCOMMAND_TOGGLE_MUTED_FROM_SOUND_BUTTON = 'treestyletab:toggle-muted-from-sound-button';
export const kCOMMAND_PERFORM_TABS_DRAG_DROP = 'treestyletab:perform-tabs-drag-drop';
export const kCOMMAND_BLOCK_USER_OPERATIONS = 'treestyletab:block-user-operations';
export const kCOMMAND_UNBLOCK_USER_OPERATIONS = 'treestyletab:unblock-user-operations';
Expand Down
2 changes: 1 addition & 1 deletion webextensions/sidebar/mouse-event-listener.js
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@ async function handleDefaultMouseUpOnTab({ lastMousedown, tab, event } = {}) {
EventUtils.isEventFiredOnSoundButton(event)) {
log('clicked on sound button');
BackgroundConnection.sendMessage({
type: Constants.kCOMMAND_TOGGLE_MUTED,
type: Constants.kCOMMAND_TOGGLE_MUTED_FROM_SOUND_BUTTON,
tabId: tab.id
});
}
Expand Down

0 comments on commit 31f7d2e

Please sign in to comment.