Skip to content

Commit

Permalink
maybe fix #4787
Browse files Browse the repository at this point in the history
  • Loading branch information
williamstein committed Aug 5, 2020
1 parent b56879b commit ae68908
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import { isEqual } from "lodash";
declare let DEBUG: boolean;

export class NotebookFrameActions {
private _is_closed: boolean = false;
private frame_tree_actions: JupyterEditorActions;
private jupyter_actions: JupyterActions;
private key_handler?: Function;
Expand All @@ -43,11 +44,7 @@ export class NotebookFrameActions {
private windowed_list_ref?: any;

constructor(frame_tree_actions: JupyterEditorActions, frame_id: string) {
bind_methods(this, [
"update_cur_id",
"syncdb_before_change",
"syncdb_after_change",
]);
bind_methods(this);

// General frame tree editor actions:
this.frame_tree_actions = frame_tree_actions;
Expand Down Expand Up @@ -174,7 +171,12 @@ export class NotebookFrameActions {
}
}

public is_closed(): boolean {
return this._is_closed;
}

public close(): void {
this._is_closed = true;
this.jupyter_actions.store.removeListener(
"syncdb-before-change",
this.syncdb_before_change
Expand Down
5 changes: 4 additions & 1 deletion src/smc-webapp/jupyter/cell-input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,10 @@ export class CellInput extends Component<CellInputProps> {
}

private handle_md_double_click(): void {
if (this.props.frame_actions == null) {
if (
this.props.frame_actions == null ||
this.props.frame_actions.is_closed()
) {
return;
}
if (this.props.cell.getIn(["metadata", "editable"]) === false) {
Expand Down

0 comments on commit ae68908

Please sign in to comment.