chore: anonymous users can upvote/downvote

This commit is contained in:
Danish Arora 2025-11-19 00:32:04 -05:00
parent e54c8c12f3
commit 51d26603d1
No known key found for this signature in database
GPG Key ID: 1C6EF37CDAE1426E
2 changed files with 3 additions and 3 deletions

View File

@ -230,7 +230,7 @@ Check user permissions for various actions.
**Data:**
- `canPost: boolean` - Can create posts (wallet or anonymous)
- `canComment: boolean` - Can create comments (wallet or anonymous)
- `canVote: boolean` - Can vote (wallet or anonymous)
- `canVote: boolean` - Can vote (wallet only)
- `canCreateCell: boolean` - Can create cells (ENS verified only)
- `canDelegate: boolean` - Can delegate keys (wallet only)
- `canModerate(cellId): boolean` - Can moderate cell (cell creator only)

View File

@ -13,7 +13,7 @@ export function usePermissions() {
const canCreateCell = isVerified;
const canPost = isConnected || isAnonymous;
const canComment = isConnected || isAnonymous;
const canVote = isConnected || isAnonymous;
const canVote = isConnected;
const canModerate = (cellId: string): boolean => {
if (!currentUser) return false;
@ -24,7 +24,7 @@ export function usePermissions() {
const reasons = {
post: canPost ? '' : 'Connect your wallet or use anonymous mode to post',
comment: canComment ? '' : 'Connect your wallet or use anonymous mode to comment',
vote: canVote ? '' : 'Connect your wallet or use anonymous mode to vote',
vote: canVote ? '' : 'Connect your wallet to vote',
createCell: canCreateCell ? '' : 'Verification required to create a cell',
moderate: (cellId: string) => (canModerate(cellId) ? '' : 'Only cell owner can moderate'),
} as const;