Skip to content

Commit

Permalink
Merge pull request #28053 from Charan-hs/Fix_26829_After_Logout_unsub…
Browse files Browse the repository at this point in the history
…scribe_keyboardshortcut's_documentedShortcuts

Fix 26829 after logout unsubscribe keyboardshortcut's documented shortcuts
  • Loading branch information
jasperhuangg authored Sep 27, 2023
2 parents cfad43f + 8187b3e commit 085ecca
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/libs/KeyboardShortcut/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ _.each(CONST.KEYBOARD_SHORTCUTS, (shortcut) => {
*/
function unsubscribe(displayName, callbackID) {
eventHandlers[displayName] = _.reject(eventHandlers[displayName], (callback) => callback.id === callbackID);
if (_.has(documentedShortcuts, displayName) && _.size(eventHandlers[displayName]) === 0) {
delete documentedShortcuts[displayName];
}
}

/**
Expand Down

0 comments on commit 085ecca

Please sign in to comment.