mirror of
https://github.com/logos-messaging/OpChan.git
synced 2026-01-05 14:23:06 +00:00
chore: anonymous users can upvote/downvote
This commit is contained in:
parent
e54c8c12f3
commit
51d26603d1
@ -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)
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user