Skip to content

Commit

Permalink
fix(app-record-locking): disable Prompt on force unlock [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavel910 committed May 15, 2024
1 parent 9d26c21 commit 4376273
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const ForceUnlocked = ({ user }: IForceUnlockedProps) => {
};

export const ContentEntryLocker = ({ children }: IContentEntryLockerProps) => {
const disablePrompt = useRef(false);
const { entry, contentModel: model } = useContentEntry();
const { updateEntryLock, unlockEntry, fetchLockedEntryLockRecord, removeEntryLock } =
useRecordLocking();
Expand All @@ -50,9 +51,8 @@ export const ContentEntryLocker = ({ children }: IContentEntryLockerProps) => {
const PromptDecorator = useMemo(() => {
return Prompt.createDecorator(Original => {
return function Prompt(props) {
return <Original {...props} />;
// const when = disablePrompt.current === true ? false : props.when;
// return <Original message={props.message} when={when} />;
const when = disablePrompt.current === true ? false : props.when;
return <Original message={props.message} when={when} />;
};
});
}, []);
Expand All @@ -74,6 +74,7 @@ export const ContentEntryLocker = ({ children }: IContentEntryLockerProps) => {
$lockingType: model.modelId
};
removeEntryLock(record);
disablePrompt.current = true;
showDialog({
title: "Entry was forcefully unlocked",
content: <ForceUnlocked user={user} />,
Expand Down

0 comments on commit 4376273

Please sign in to comment.