mirror of
https://github.com/zadam/trilium.git
synced 2025-12-23 08:39:57 +01:00
fix(badges): "temporarily editable" remaining after changing editability
This commit is contained in:
@@ -22,11 +22,10 @@ export default function NoteBadges() {
|
||||
|
||||
function ReadOnlyBadge() {
|
||||
const { note, noteContext } = useNoteContext();
|
||||
const { isReadOnly, enableEditing } = useIsNoteReadOnly(note, noteContext);
|
||||
const { isReadOnly, enableEditing, temporarilyEditable } = useIsNoteReadOnly(note, noteContext);
|
||||
const isExplicitReadOnly = note?.isLabelTruthy("readOnly");
|
||||
const isTemporarilyEditable = noteContext?.ntxId !== "_popup-editor" && noteContext?.viewScope?.readOnlyTemporarilyDisabled;
|
||||
|
||||
if (isTemporarilyEditable) {
|
||||
if (temporarilyEditable) {
|
||||
return <Badge
|
||||
icon="bx bx-lock-open-alt"
|
||||
text={t("breadcrumb_badges.read_only_temporarily_disabled")}
|
||||
|
||||
Reference in New Issue
Block a user