From 4d61e34287941849a607361a97d001acef87743a Mon Sep 17 00:00:00 2001 From: Julius Knorr Date: Thu, 19 Dec 2024 14:08:49 +0100 Subject: [PATCH] fix: Use icons instead of avatar for locking indication Signed-off-by: Julius Knorr --- src/main.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/main.ts b/src/main.ts index 0a530b8f..c60a33a0 100644 --- a/src/main.ts +++ b/src/main.ts @@ -18,7 +18,6 @@ import { lockFile, unlockFile } from './api' import { LockType } from './types' import { canLock, canUnlock, - generateAvatarSvg, getInfoLabel, getLockStateFromAttributes, } from './helper' @@ -29,6 +28,8 @@ import '@nextcloud/dialogs/style.css' import LockSvg from '@mdi/svg/svg/lock.svg?raw' import LockOpenSvg from '@mdi/svg/svg/lock-open-variant.svg?raw' import LockEditSvg from '@mdi/svg/svg/pencil-lock.svg?raw' +import LockMonitorSvg from '@mdi/svg/svg/monitor-lock.svg?raw' +import LockAccountSvg from '@mdi/svg/svg/account-lock.svg?raw' const switchLock = async (node: Node) => { try { @@ -73,14 +74,18 @@ const inlineAction = new FileAction({ return '' } - if (state.isLocked && state.lockOwnerType !== LockType.App && state.lockOwner !== getCurrentUser()?.uid) { - return generateAvatarSvg(state.lockOwner) + if (state.lockOwnerType === LockType.Token) { + return LockMonitorSvg } if (state.lockOwnerType === LockType.App) { return LockEditSvg } + if (state.lockOwner !== getCurrentUser()?.uid) { + return LockAccountSvg + } + return LockSvg },