Skip to content

Commit cdea4ab

Browse files
committed
only show document when at least one version has been loaded (otherwise editing is weird)
1 parent 9152178 commit cdea4ab

File tree

1 file changed

+4
-2
lines changed
  • src/packages/frontend/frame-editors/code-editor

1 file changed

+4
-2
lines changed

src/packages/frontend/frame-editors/code-editor/actions.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,10 @@ export class Actions<
258258
// Init setting of value whenever syncstring changes -- only used in derived classes
259259
protected _init_syncstring_value(): void {
260260
this._syncstring.on("change", () => {
261-
if (!this._syncstring) {
262-
// edge case where actions closed but this event was still triggered.
261+
if (!this._syncstring || this._syncstring.versions().length == 0) {
262+
// edge case where actions closed but this event was still triggered, OR
263+
// the syncstring changed, but has not actually loaded a version from
264+
// disk yet, which happens with compute servers for a second.
263265
return;
264266
}
265267
this.setState({ value: this._syncstring.to_str() });

0 commit comments

Comments
 (0)