Skip to content

Commit

Permalink
Set collaborative attribute to False in Jupyterlite (jupytercad#525)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
3 people authored Oct 22, 2024
1 parent 1fa6bce commit 9fde6ed
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion packages/schema/src/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ export class JupyterCadModel implements IJupyterCadModel {
}
};

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

get sharedModel(): IJupyterCadDoc {
return this._sharedModel;
Expand Down
3 changes: 2 additions & 1 deletion python/jupytercad_core/src/jcadplugin/modelfactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ export class JupyterCadJcadModelFactory
/**
* Whether the model is collaborative or not.
*/
readonly collaborative = true;
readonly collaborative =
document.querySelectorAll('[data-jupyter-lite-root]')[0] === undefined;

/**
* The name of the model.
Expand Down
3 changes: 2 additions & 1 deletion python/jupytercad_core/src/stepplugin/modelfactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ export class JupyterCadStepModelFactory
/**
* Whether the model is collaborative or not.
*/
readonly collaborative = true;
readonly collaborative =
document.querySelectorAll('[data-jupyter-lite-root]')[0] === undefined;

/**
* The name of the model.
Expand Down
3 changes: 2 additions & 1 deletion python/jupytercad_core/src/stlplugin/modelfactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ export class JupyterCadStlModelFactory
/**
* Whether the model is collaborative or not.
*/
readonly collaborative = true;
readonly collaborative =
document.querySelectorAll('[data-jupyter-lite-root]')[0] === undefined;

/**
* The name of the model.
Expand Down

0 comments on commit 9fde6ed

Please sign in to comment.