@@ -19,26 +19,24 @@ function GoToWorkspaceHandler() {
1919 const shortcutConfig = CONST . KEYBOARD_SHORTCUTS . GO_TO_WORKSPACE ;
2020 const unsubscribe = KeyboardShortcut . subscribe (
2121 shortcutConfig . shortcutKey ,
22- callFunctionIfActionIsAllowed (
23- ( ) => {
24- const reportID = Navigation . getTopmostReportId ( ) ;
25- if ( ! reportID ) {
26- return ;
27- }
28-
29- const report = getReportOrDraftReport ( reportID ) ;
30- const policyID = report ?. policyID ?? ( report ?. parentReportID ? getReportOrDraftReport ( report . parentReportID ) ?. policyID : undefined ) ;
31- if ( ! policyID || policyID === CONST . POLICY . ID_FAKE ) {
32- return ;
33- }
34-
35- const route = shouldUseNarrowLayoutRef . current ? ROUTES . WORKSPACE_INITIAL . getRoute ( policyID , Navigation . getActiveRoute ( ) ) : ROUTES . WORKSPACE_OVERVIEW . getRoute ( policyID ) ;
36- Navigation . navigate ( route ) ;
37- } ,
38- shortcutConfig . descriptionKey ,
39- shortcutConfig . modifiers ,
40- true ,
41- ) ,
22+ callFunctionIfActionIsAllowed ( ( ) => {
23+ const reportID = Navigation . getTopmostReportId ( ) ;
24+ if ( ! reportID ) {
25+ return ;
26+ }
27+
28+ const report = getReportOrDraftReport ( reportID ) ;
29+ const policyID = report ?. policyID ?? ( report ?. parentReportID ? getReportOrDraftReport ( report . parentReportID ) ?. policyID : undefined ) ;
30+ if ( ! policyID || policyID === CONST . POLICY . ID_FAKE ) {
31+ return ;
32+ }
33+
34+ const route = shouldUseNarrowLayoutRef . current ? ROUTES . WORKSPACE_INITIAL . getRoute ( policyID , Navigation . getActiveRoute ( ) ) : ROUTES . WORKSPACE_OVERVIEW . getRoute ( policyID ) ;
35+ Navigation . navigate ( route ) ;
36+ } ) ,
37+ shortcutConfig . descriptionKey ,
38+ shortcutConfig . modifiers ,
39+ true ,
4240 ) ;
4341
4442 return ( ) => unsubscribe ( ) ;
0 commit comments