Skip to content

Commit

Permalink
fix: Workaround for inline action not checking enabled on updates
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Knorr <jus@bitgrid.net>
  • Loading branch information
juliusknorr committed Nov 15, 2024
1 parent d9e902d commit 111d146
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ const inlineAction = new FileAction({
const node = nodes[0]

const state = getLockStateFromAttributes(node)

if (!state.isLocked) {
return ''
}

if (state.isLocked && state.lockOwnerType !== LockType.App && state.lockOwner !== getCurrentUser()?.uid) {
return generateAvatarSvg(state.lockOwner)
}
Expand All @@ -85,6 +90,10 @@ const inlineAction = new FileAction({
return false
}

// FIXME: Currently enabled is not re-evaluated when emitting an updated node object through files:node:updated
// Therefor we need to also have a unlocked state as the inline action is then always rendered
return true

const node = nodes[0]
const state = getLockStateFromAttributes(node)

Expand Down

0 comments on commit 111d146

Please sign in to comment.