anbv29 commented on code in PR #703:
URL: https://github.com/apache/shenyu-dashboard/pull/703#discussion_r4231671365
##########
src/routes/Plugin/Common/index.js:
##########
@@ -94,18 +94,20 @@ export default class Common extends Component {
type: "common/resetData",
});
- if (prevProps.plugins && prevProps.plugins.length > 0) {
- this.getAllSelectors(selectorPage, selectorPageSize,
prevProps.plugins);
- } else {
- dispatch({
- type: "global/fetchPlugins",
- payload: {
- callback: (pluginList) => {
- this.getAllSelectors(selectorPage, selectorPageSize, pluginList);
+ this.setState({ selectorPage: 1 }, () => {
+ if (prevProps.plugins && prevProps.plugins.length > 0) {
+ this.getAllSelectors(1, selectorPageSize, prevProps.plugins);
+ } else {
+ dispatch({
+ type: "global/fetchPlugins",
+ payload: {
+ callback: (pluginList) => {
+ this.getAllSelectors(1, selectorPageSize, pluginList);
+ },
},
- },
- });
- }
+ });
+ }
+ });
Review Comment:
Updated in f5898ce to use the current plugin list from props. Added
regression tests for navigation occurring alongside an empty-to-populated or
stale plugin-list update.
--
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]