Переглянути джерело

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);
     }
   }