File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
frontend/src/scenes/experiments/SharedMetrics Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -110,6 +110,9 @@ export function SharedMetric(): JSX.Element {
110110 setSharedMetric ( {
111111 tags : tags ,
112112 } )
113+ if ( action === 'update' ) {
114+ updateSharedMetric ( false )
115+ }
113116 } }
114117 canEdit
115118 tags = { sharedMetric . tags }
Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ export const sharedMetricLogic = kea<sharedMetricLogicType>([
5252 actions ( {
5353 setSharedMetric : ( metric : Partial < SharedMetric > ) => ( { metric } ) ,
5454 createSharedMetric : true ,
55- updateSharedMetric : true ,
55+ updateSharedMetric : ( redirect ?: boolean ) => ( { redirect } ) ,
5656 deleteSharedMetric : true ,
5757 } ) ,
5858
@@ -102,15 +102,17 @@ export const sharedMetricLogic = kea<sharedMetricLogicType>([
102102 router . actions . push ( '/experiments?tab=shared-metrics' )
103103 }
104104 } ,
105- updateSharedMetric : async ( ) => {
105+ updateSharedMetric : async ( { redirect = true } : { redirect ?: boolean } = { } ) => {
106106 const response = await api . update (
107107 `api/projects/@current/experiment_saved_metrics/${ values . sharedMetricId } ` ,
108108 values . sharedMetric
109109 )
110110 if ( response . id ) {
111111 lemonToast . success ( 'Shared metric updated successfully' )
112112 actions . loadSharedMetrics ( )
113- router . actions . push ( '/experiments?tab=shared-metrics' )
113+ if ( redirect ) {
114+ router . actions . push ( '/experiments?tab=shared-metrics' )
115+ }
114116 }
115117 } ,
116118 deleteSharedMetric : async ( ) => {
You can’t perform that action at this time.
0 commit comments