Skip to content

Commit 3c23911

Browse files
authored
Merge pull request #292 from ls1intum/test/disable-undo-manager-for-colloboration
test: disable undo manager in colloboration
2 parents 2356f45 + 6f07b34 commit 3c23911

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

library/lib/apollon-editor.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,13 @@ export class ApollonEditor {
9797
this.metadataStore.getState().setDebug(options.debug)
9898
}
9999

100-
if (this.metadataStore.getState().mode === Apollon.ApollonMode.Modelling) {
100+
if (
101+
this.metadataStore.getState().mode === Apollon.ApollonMode.Modelling &&
102+
!options?.collaborationEnabled
103+
) {
101104
this.diagramStore.getState().initializeUndoManager()
102105
}
106+
103107
this.root.render(
104108
<DiagramStoreContext.Provider value={this.diagramStore}>
105109
<MetadataStoreContext.Provider value={this.metadataStore}>

library/lib/typings.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ export type ApollonOptions = {
8282
colorEnabled?: boolean
8383
scale?: number
8484
debug?: boolean
85+
collaborationEnabled?: boolean
8586
}
8687

8788
export type FeedbackCorrectionStatus = {

standalone/webapp/src/pages/ApollonWithConnection.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ export const ApollonWithConnection: React.FC = () => {
3939

4040
const editorOptions: ApollonOptions = {
4141
model: diagram,
42+
collaborationEnabled: true,
4243
}
4344

4445
if (viewType === DiagramView.GIVE_FEEDBACK) {

0 commit comments

Comments
 (0)