Show feedback prompt only once (#43164)

* Show feedback prompt only once

* Add changelog

* Fix feedback prompt

* Move changelog

* Fix feedback prompt visibility

* Add modalShown logic to ces
This commit is contained in:
Fernando Marichal 2024-01-15 14:44:38 -03:00 committed by GitHub
parent d329ced1e8
commit d929994afb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 13 deletions

View File

@ -0,0 +1,4 @@
Significance: minor
Type: fix
Show feedback prompt only once #43164

View File

@ -91,15 +91,14 @@ function _CustomerEffortScoreTracks( {
ces_location: 'inside', ces_location: 'inside',
...trackProps, ...trackProps,
} ); } );
}; if ( ! cesShownForActions || ! cesShownForActions.includes( action ) ) {
updateOptions( {
const addActionToShownOption = () => { [ SHOWN_FOR_ACTIONS_OPTION_NAME ]: [
updateOptions( { action,
[ SHOWN_FOR_ACTIONS_OPTION_NAME ]: [ ...( cesShownForActions || [] ),
action, ],
...( cesShownForActions || [] ), } );
], }
} );
}; };
const onNoticeDismissed = () => { const onNoticeDismissed = () => {
@ -109,8 +108,6 @@ function _CustomerEffortScoreTracks( {
ces_location: 'inside', ces_location: 'inside',
...trackProps, ...trackProps,
} ); } );
addActionToShownOption();
}; };
const onModalDismissed = () => { const onModalDismissed = () => {
@ -131,8 +128,6 @@ function _CustomerEffortScoreTracks( {
ces_location: 'inside', ces_location: 'inside',
...trackProps, ...trackProps,
} ); } );
addActionToShownOption();
}; };
const recordScore = ( score, secondScore, comments ) => { const recordScore = ( score, secondScore, comments ) => {