瀏覽代碼

do not emit path changed until the session path changes

Steven Silvester 8 年之前
父節點
當前提交
3b8c71126f
共有 1 個文件被更改,包括 4 次插入3 次删除
  1. 4 3
      src/docregistry/context.ts

+ 4 - 3
src/docregistry/context.ts

@@ -415,11 +415,12 @@ class Context<T extends DocumentRegistry.IModel> implements DocumentRegistry.ICo
       return;
     }
     if (change.oldValue.path === this._path) {
-      let path = this._path = change.newValue.path;
       if (this._session) {
-        this._session.rename(path);
+        this._session.rename(change.newValue.path);
+      } else {
+        this._path = change.newValue.path;
+        this.pathChanged.emit(this._path);
       }
-      this.pathChanged.emit(path);
     }
   }