Skip to content

Commit

Permalink
Refresh file browser on head change (jupyterlab#950)
Browse files Browse the repository at this point in the history
  • Loading branch information
navn-r committed Jun 29, 2021
1 parent c5e09cb commit 6c9e906
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,12 @@ async function activate(
gitExtension.pathRepository = change.newValue;
}
);

// Whenever the `HEAD` of the Git repository changes, refresh the file browser
gitExtension.headChanged.connect(() => {
filebrowser.model.refresh();
});

// Whenever a user adds/renames/saves/deletes/modifies a file within the lab environment, refresh the Git status
app.serviceManager.contents.fileChanged.connect(() =>
gitExtension.refreshStatus()
Expand Down

0 comments on commit 6c9e906

Please sign in to comment.