CaptainAni187 opened a new pull request, #711:
URL: https://github.com/apache/shenyu-dashboard/pull/711

   Fixes #602
   
   dva-loading 2.0.6 dispatches HIDE only after the wrapped effect returns. 
Since `src/index.js` registers no `onError` hook, dva-core rethrows effect 
errors, so a rejected request skips HIDE and `loading.effects[...]`, the model 
flag and `loading.global` stay `true`. A cancelled effect has the same problem.
   
   This adds `src/utils/loading.js`, a small wrapper around dva-loading that 
keeps its reducer and `only`/`except` handling but dispatches HIDE from a 
`finally`. `src/index.js` uses it instead of `dva-loading` directly. The 
request rejection contract and the 204 handling are unchanged.
   
   Tests in `src/utils/loading.test.js` cover a resolved effect, the real 
`global/fetchPlatform` effect with `queryPlatform` rejecting, a cancelled 
effect, and an effect excluded by `only`. The rejected and cancelled cases fail 
with plain dva-loading.
   
   `npm run test:coverage`, `npm run lint` and `npm run build` pass locally.
   


-- 
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