Skip to content

Commit ea33cd2

Browse files
committed
finish fix #6580 -- jupyter: misleading state when opening readonly files
- much of this work is in previous commits; this is the one that deals with the backend state
1 parent 0e26000 commit ea33cd2

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/packages/sync/editor/generic/sync-doc.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,8 +415,6 @@ export class SyncDoc extends EventEmitter {
415415
});
416416

417417
private getFileServerPath = () => {
418-
// id of who the user *wants* to be the file server.
419-
this.path;
420418
if (this.path?.endsWith(".sage-jupyter2")) {
421419
// treating jupyter as a weird special case here.
422420
return auxFileToOriginal(this.path);
@@ -1557,6 +1555,14 @@ export class SyncDoc extends EventEmitter {
15571555
path: this.path,
15581556
mode: "w",
15591557
});
1558+
// also check on the original file in case of Jupyter:
1559+
const path = this.getFileServerPath();
1560+
if (path != this.path) {
1561+
await callback2(this.client.path_access, {
1562+
path,
1563+
mode: "w",
1564+
});
1565+
}
15601566
// no error -- it is NOT read only
15611567
return false;
15621568
} catch (err) {

0 commit comments

Comments
 (0)