Skip to content

Commit

Permalink
fix modeler: set to viewer mode when version is selected
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasMGo committed Oct 17, 2023
1 parent a4f4512 commit a351daa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/management-system-v2/components/modeler.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const Modeler: FC<ModelerProps> = ({ minimized, ...props }) => {
// This is not the most recent instance, so don't do anything.
if (active !== modeler.current) return;

if (editingDisabled) {
if (selectedVersionId !== null) {
modeler.current = new Viewer!({
container: canvas.current!,
moddleExtensions: {
Expand Down Expand Up @@ -103,7 +103,7 @@ const Modeler: FC<ModelerProps> = ({ minimized, ...props }) => {
modeler.current?.destroy();
};
// only reset the modeler if we switch between editing being enabled or disabled
}, [setModeler, editingDisabled, processId, updateProcessMutation]);
}, [setModeler, editingDisabled, selectedVersionId, processId, updateProcessMutation]);

const { data: processBpmn } = useProcessBpmn(processId as string, selectedVersionId);

Expand Down

0 comments on commit a351daa

Please sign in to comment.