feat: enhance user limits
This commit is contained in:
@@ -73,8 +73,11 @@ export function TextSelectionToolbar() {
|
||||
};
|
||||
}, [user]);
|
||||
|
||||
const bookmarkLimit = user?.plan === "premium" ? 5 : 1;
|
||||
const limitReached = !!user && bookmarkCount >= bookmarkLimit;
|
||||
// Effective bookmark cap from the server (plan default merged with any admin
|
||||
// override). -1 would mean unlimited (never reached).
|
||||
const bookmarkLimit = user?.limits?.bookmarks ?? 1;
|
||||
const limitReached =
|
||||
!!user && bookmarkLimit >= 0 && bookmarkCount >= bookmarkLimit;
|
||||
|
||||
// Track whether the user is interacting with our toolbar/popovers
|
||||
const interactingRef = useRef(false);
|
||||
|
||||
Reference in New Issue
Block a user