Fix #3470 Notebook: Switching between Servers and File Explorer opens a duplicate notebook (#3500)

- We missed implementing matches functionality. This is required in order to skip reopening of the notebook
This commit is contained in:
Kevin Cunnane
2018-12-07 12:14:26 -08:00
committed by GitHub
parent 3b08721835
commit 8aeb33c98c

View File

@@ -177,4 +177,20 @@ export class NotebookInput extends EditorInput {
setDirty(isDirty: boolean): void {
this._model.setDirty(isDirty);
}
public matches(otherInput: any): boolean {
if (super.matches(otherInput) === true) {
return true;
}
if (otherInput instanceof NotebookInput) {
const otherNotebookEditorInput = <NotebookInput>otherInput;
// Compare by resource
return otherNotebookEditorInput.notebookUri.toString() === this.notebookUri.toString();
}
return false;
}
}