fix(badges): "temporarily editable" remaining after changing editability

This commit is contained in:
Elian Doran
2025-12-16 19:40:24 +02:00
parent 90a7217b32
commit 737e5b85b4
2 changed files with 7 additions and 4 deletions

View File

@@ -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")}