* Display credit balance for all accounts The credit balance display was previously only shown for personal accounts. This change removes the check for `activeOrganization === null` and displays the credit balance and "Add Credits" button for all account types, including organization accounts. A divider is added above the balance section for visual separation once the backend change is deployed. * changeset * Improve refresh logic Refactors the `AccountView` component to properly display and manage credits for both user and organization accounts. It introduces the `getOrganizationCredits` API call to fetch organization-specific credits and updates the UI accordingly. The refresh logic has also been improved to ensure data consistency and prevent unnecessary API calls. Key changes: - Implemented `getOrganizationCredits` to fetch credits for the active organization. - Modified the credit display to show organization credits when an organization is active. - Updated the refresh logic to use `useCallback` and `debounce` for better performance and to prevent race conditions. - Added a periodic refresh to update account data every 30 seconds. - Improved error handling and loading state management. - Removed the interval ref and replaced it with a simpler useEffect for periodic refresh. - Added last fetch time to the UI. * clean up * deepEqual * org management * prevent race condition
Changesets
Hello and welcome! This folder has been automatically generated by @changesets/cli, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it in our repository
We have a quick list of common questions to get you started engaging with this project in our documentation