dengliming opened a new issue, #608:
URL: https://github.com/apache/shenyu-dashboard/issues/608

   ## Description
   `isPluginEnabled` starts as `false` in state and is only ever updated by the 
toggle handlers. Unlike `src/routes/Plugin/Common/index.js` and 
`src/routes/Plugin/McpServer/index.js`, which derive it from the `plugins` prop 
in `getAllSelectors`, the Discovery page never reads the actual enabled flag.
   
   ## Location
   (Lines refer to `master @ 83969a5`.)
   - `src/routes/Plugin/Discovery/index.js:74` (initial state)
   - `src/routes/Plugin/Discovery/index.js:152-159` (`enabled = 
!this.state.isPluginEnabled`)
   - `src/routes/Plugin/Discovery/index.js:535-538` (tag rendering)
   
   ## Impact
   The TCP plugin page always shows the plugin as closed even when it is 
enabled; clicking the switch the first time sends `enabled: true` for an 
already-enabled plugin (or, after a page refresh where the real state is 
enabled, the displayed state is simply wrong).
   
   ## Suggested fix
   Initialize `isPluginEnabled` from `plugins.find(p => p.name === 
pluginName)?.enabled` in `componentDidMount`/`componentDidUpdate`, mirroring 
`Common/index.js`.
   
   ## Related existing
   None
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to