@@ -112,27 +112,27 @@ export const DataManagerPage = ({ ...props }) => {
112112 }
113113
114114 if ( isMissingTaskError ) {
115- history . push ( buildLink ( "" , { id : params . id } ) ) ;
115+ history . push ( buildLink ( "" , { id : params ?. id ?? project ? .id } ) ) ;
116116 } else if ( isMissingProjectError ) {
117117 history . push ( "/projects" ) ;
118118 }
119119 } ) ;
120120
121121 dataManager . on ( "settingsClicked" , ( ) => {
122- history . push ( buildLink ( "/settings/labeling" , { id : params . id } ) ) ;
122+ history . push ( buildLink ( "/settings/labeling" , { id : params ?. id ?? project ? .id } ) ) ;
123123 } ) ;
124124
125125 dataManager . on ( "importClicked" , ( ) => {
126- history . push ( buildLink ( "/data/import" , { id : params . id } ) ) ;
126+ history . push ( buildLink ( "/data/import" , { id : params ?. id ?? project ? .id } ) ) ;
127127 } ) ;
128128
129129 // Navigate to Storage Settings and auto-open Add Source Storage modal
130130 dataManager . on ( "openSourceStorageModal" , ( ) => {
131- history . push ( buildLink ( "/settings/storage?open=source" , { id : params . id } ) ) ;
131+ history . push ( buildLink ( "/settings/storage?open=source" , { id : params ?. id ?? project ? .id } ) ) ;
132132 } ) ;
133133
134134 dataManager . on ( "exportClicked" , ( ) => {
135- history . push ( buildLink ( "/data/export" , { id : params . id } ) ) ;
135+ history . push ( buildLink ( "/data/export" , { id : params ?. id ?? project ? .id } ) ) ;
136136 } ) ;
137137
138138 dataManager . on ( "error" , ( response ) => {
@@ -146,7 +146,7 @@ export const DataManagerPage = ({ ...props }) => {
146146 dataManager . on ( "navigate" , ( route ) => {
147147 const target = route . replace ( / ^ p r o j e c t s / , "" ) ;
148148
149- if ( target ) history . push ( buildLink ( target , { id : params . id } ) ) ;
149+ if ( target ) history . push ( buildLink ( target , { id : params ?. id ?? project ? .id } ) ) ;
150150 else history . push ( "/projects" ) ;
151151 } ) ;
152152
0 commit comments