提交 51c19493 编写于 作者: P Peng Lyu

Progress bar for pr switching

上级 1c7b91d7
......@@ -39,7 +39,12 @@ export class PRProvider implements vscode.TreeDataProvider<PRGroupTreeItem | Pul
this.repository = repository;
this.context.subscriptions.push(vscode.window.registerTreeDataProvider<PRGroupTreeItem | PullRequestModel | FileChangeTreeItem>('pr', this));
this.context.subscriptions.push(vscode.commands.registerCommand('pr.pick', async (pr: PullRequestModel) => {
await this.reviewManager.switch(pr);
vscode.window.withProgress({
location: vscode.ProgressLocation.SourceControl,
title: `Switching to Pull Request #${pr.prNumber}`,
}, async (progress, token) => {
await this.reviewManager.switch(pr);
});
}));
this.context.subscriptions.push(this.configuration.onDidChange(e => {
this._onDidChangeTreeData.fire();
......
......@@ -443,7 +443,7 @@ export class ReviewManager implements vscode.DecorationProvider {
});
}
async switch(pr: PullRequestModel) {
async switch(pr: PullRequestModel): Promise<void> {
this.statusBarItem.text = '$(sync~spin) Switching to Review Mode';
this.statusBarItem.show();
......@@ -470,6 +470,9 @@ export class ReviewManager implements vscode.DecorationProvider {
// todo, we should try to recover, for example, git checkout succeeds but set config fails.
return;
}
await this._repository.status();
await this.validateState();
}
clear(quitReviewMode: boolean) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册