Skip to content

Commit 9fde6ed

Browse files
martinRenoupre-commit-ci[bot]trungleduc
authored
Set collaborative attribute to False in Jupyterlite (#525)
* Set collaborative attribute to False in Jupyterlite This has the side effect of fixing the saving of files in JupyterLite for now * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Apply suggestions from code review Co-authored-by: Duc Trung Le <[email protected]> * It's true that it's not false --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Duc Trung Le <[email protected]>
1 parent 1fa6bce commit 9fde6ed

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

packages/schema/src/model.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ export class JupyterCadModel implements IJupyterCadModel {
4040
}
4141
};
4242

43-
readonly collaborative = true;
43+
readonly collaborative =
44+
document.querySelectorAll('[data-jupyter-lite-root]')[0] === undefined;
4445

4546
get sharedModel(): IJupyterCadDoc {
4647
return this._sharedModel;

python/jupytercad_core/src/jcadplugin/modelfactory.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ export class JupyterCadJcadModelFactory
1919
/**
2020
* Whether the model is collaborative or not.
2121
*/
22-
readonly collaborative = true;
22+
readonly collaborative =
23+
document.querySelectorAll('[data-jupyter-lite-root]')[0] === undefined;
2324

2425
/**
2526
* The name of the model.

python/jupytercad_core/src/stepplugin/modelfactory.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ export class JupyterCadStepModelFactory
1111
/**
1212
* Whether the model is collaborative or not.
1313
*/
14-
readonly collaborative = true;
14+
readonly collaborative =
15+
document.querySelectorAll('[data-jupyter-lite-root]')[0] === undefined;
1516

1617
/**
1718
* The name of the model.

python/jupytercad_core/src/stlplugin/modelfactory.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ export class JupyterCadStlModelFactory
1111
/**
1212
* Whether the model is collaborative or not.
1313
*/
14-
readonly collaborative = true;
14+
readonly collaborative =
15+
document.querySelectorAll('[data-jupyter-lite-root]')[0] === undefined;
1516

1617
/**
1718
* The name of the model.

0 commit comments

Comments
 (0)