mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-23 05:25:53 +08:00
refactor(core): use overcapacityMemberCount for quota checking instead of calculating the difference (#12117)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Bug Fixes** - Improved accuracy of member quota warnings by updating the logic that detects when the member limit has been exceeded. - Enhanced test reliability by adjusting member list pagination test to better handle confirmation modals. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -57,8 +57,7 @@ export const QuotaCheck = ({
|
||||
if (workspaceMeta.flavour === 'local' || !quota || isTeam) {
|
||||
return;
|
||||
}
|
||||
const memberOverflow = quota.memberCount > quota.memberLimit;
|
||||
// remember to use real percent
|
||||
const memberOverflow = quota.overcapacityMemberCount > 0;
|
||||
const storageOverflow = usedPercent && usedPercent >= 100;
|
||||
const message = getSyncPausedMessage(
|
||||
!!isOwner,
|
||||
|
||||
@@ -62,8 +62,6 @@ test('should have pagination in member list', async ({ page }) => {
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.getByTestId('confirm-modal-cancel').click();
|
||||
|
||||
const firstPageMemberItemCount = await page
|
||||
.locator('[data-testid="member-item"]')
|
||||
.count();
|
||||
|
||||
Reference in New Issue
Block a user