Fix core profiler extensions page from selecting activated plugins (#52029)

* Add check to disallow selecting activated plugins

* Changelog
This commit is contained in:
Ilyas Foo 2024-10-16 11:00:36 +08:00 committed by GitHub
parent 63fdf72645
commit e49009b9a9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 0 deletions

View File

@ -0,0 +1,4 @@
Significance: patch
Type: fix
Core profiler remove selecting activated plugins in extensions page

View File

@ -62,6 +62,10 @@ export const Plugins = ( {
);
const setSelectedPlugin = ( plugin: Extension ) => {
// Don't allow selecting a plugin that is already activated.
if ( plugin.is_activated ) {
return;
}
setSelectedPlugins(
selectedPlugins.some( ( item ) => item.key === plugin.key )
? selectedPlugins.filter( ( item ) => item.key !== plugin.key )