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