mirror of
https://github.com/langgenius/dify.git
synced 2026-08-04 21:06:49 +08:00
The previous implementation stored query invalidation logic (mutateCurrentWorkspace) and isFetching state (isValidatingCurrentWorkspace) in React Context, causing QuotaPanel to flash a loading spinner on every settings tab switch due to a useEffect calling invalidateQueries on mount. This violated separation of concerns and React best practices. - Remove mutateCurrentWorkspace and isValidatingCurrentWorkspace from AppContext - Add useInvalidateCurrentWorkspace hook in service layer (consistent with project pattern) - Remove redundant useEffect + invalidateQueries in ModelProviderPage - QuotaPanel now derives loading from !currentWorkspace.id instead of external prop - Update custom-web-app-brand to use the new service-layer hook |
||
|---|---|---|
| .. | ||
| hooks | ||
| access-control-store.ts | ||
| app-context.tsx | ||
| app-list-context.ts | ||
| dataset-detail.ts | ||
| datasets-context.tsx | ||
| debug-configuration.ts | ||
| event-emitter.tsx | ||
| explore-context.ts | ||
| external-api-panel-context.tsx | ||
| external-knowledge-api-context.tsx | ||
| global-public-context.tsx | ||
| i18n.spec.ts | ||
| i18n.ts | ||
| mitt-context.tsx | ||
| modal-context.test.tsx | ||
| modal-context.tsx | ||
| provider-context-mock.spec.tsx | ||
| provider-context-mock.tsx | ||
| provider-context.tsx | ||
| query-client-server.ts | ||
| query-client.tsx | ||
| web-app-context.tsx | ||
| workspace-context.tsx | ||