From 111d1460505451523b548fc23f952487f7225061 Mon Sep 17 00:00:00 2001 From: Julius Knorr Date: Fri, 15 Nov 2024 10:34:02 +0100 Subject: [PATCH] fix: Workaround for inline action not checking enabled on updates Signed-off-by: Julius Knorr --- src/main.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main.ts b/src/main.ts index bf3454e2..0a530b8f 100644 --- a/src/main.ts +++ b/src/main.ts @@ -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) } @@ -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)