Skip to content

Commit 80af1a9

Browse files
authored
Merge pull request #308 from nextcloud/backport/306/stable28
[stable28] fix: Show lock status for read only files and allow unlocking
2 parents 87b8ab9 + 83ec0b0 commit 80af1a9

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/main.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ const inlineAction = new FileAction({
8585
const node = nodes[0]
8686
const state = getLockStateFromAttributes(node)
8787

88-
return (node.permissions & Permission.UPDATE) !== 0 && state.isLocked
88+
return state.isLocked
8989
},
9090
})
9191

@@ -115,8 +115,10 @@ const menuAction = new FileAction({
115115
}
116116

117117
const canToggleLock = canLock(nodes[0]) || canUnlock(nodes[0])
118+
const isLocked = getLockStateFromAttributes(nodes[0]).isLocked
119+
const isUpdatable = (nodes[0].permissions & Permission.UPDATE) !== 0
118120

119-
return nodes[0].type === FileType.File && canToggleLock && (nodes[0].permissions & Permission.UPDATE) !== 0
121+
return nodes[0].type === FileType.File && canToggleLock && (isUpdatable || isLocked)
120122
},
121123

122124
async exec(node: Node) {

0 commit comments

Comments
 (0)