Simplify unclaim logic - only for claimed state

Refine unclaim button visibility to prevent confusing UX where users could "unclaim" status updates they didn't claim.

Changes:
- Only show "Unclaim" button when task is in "claimed" state
- Remove "Unclaim" button from in-progress and completed states
- Maintain check that current user must be the claimer

Rationale:
- Prevents confusion where user marks task in-progress but sees "Unclaim"
- "Unclaim" makes sense only for the original claim action
- Users can still update status (mark in-progress/complete) on any task
- But only the claimer can unclaim the original claim

Example scenarios:
- Alice claims task → Alice sees "Unclaim" button
- Bob marks Alice's task as in-progress → Bob does NOT see "Unclaim"
- Only Alice can unclaim, reverting task to unclaimed state

This simple rule prevents UX confusion until we implement full per-user status tracking.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
padreug 2025-11-16 21:01:38 +01:00
parent d0b3396af7
commit 4e85488921

View file

@ -74,9 +74,11 @@ const completion = computed(() => props.getCompletion(eventAddress.value, occurr
// Get current user's pubkey
const currentUserPubkey = computed(() => authService?.user.value?.pubkey)
// Check if current user can unclaim (only if they created the current status)
// Check if current user can unclaim
// Only show unclaim for "claimed" state, and only if current user is the one who claimed it
const canUnclaim = computed(() => {
if (!completion.value || !currentUserPubkey.value) return false
if (taskStatus.value !== 'claimed') return false
return completion.value.pubkey === currentUserPubkey.value
})