Fixes #6218
This commit is contained in:
Alex Ross 2024-09-17 17:46:32 +02:00 коммит произвёл GitHub
Родитель f6aa0bd6a4
Коммит 1066de65a4
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
3 изменённых файлов: 8 добавлений и 9 удалений

Просмотреть файл

@ -204,9 +204,9 @@ export class PrsTreeModel implements vscode.Disposable {
return { hasMorePages: false, hasUnsearchedRepositories: false, items: prs };
}
async getPullRequestsForQuery(folderRepoManager: FolderRepositoryManager, fetchNextPage: boolean, query: string, update?: boolean): Promise<ItemsResponseResult<PullRequestModel>> {
async getPullRequestsForQuery(folderRepoManager: FolderRepositoryManager, fetchNextPage: boolean, query: string): Promise<ItemsResponseResult<PullRequestModel>> {
const cache = this.getFolderCache(folderRepoManager);
if (!update && cache.has(query)) {
if (!fetchNextPage && cache.has(query)) {
return cache.get(query)!;
}

Просмотреть файл

@ -38,7 +38,6 @@ import { RemoteFileChangeModel } from './fileChangeModel';
import { ReviewManager } from './reviewManager';
import { ReviewModel } from './reviewModel';
import { GitFileChangeNode, gitFileChangeNodeFilter, RemoteFileChangeNode } from './treeNodes/fileChangeNode';
import { IDisposable } from 'cockatiel';
export interface SuggestionInformation {
originalStartLine: number;
@ -362,7 +361,7 @@ export class ReviewCommentController extends CommentControllerBase
this._localToDispose.push(vscode.window.onDidChangeActiveTextEditor(e => this.onDidChangeActiveTextEditor(e)));
}
private _commentContentChangedListner: IDisposable | undefined;
private _commentContentChangedListner: vscode.Disposable | undefined;
private onDidChangeActiveTextEditor(editor: vscode.TextEditor | undefined) {
this._commentContentChangedListner?.dispose();
this._commentContentChangedListner = undefined;

Просмотреть файл

@ -316,6 +316,8 @@ export class CategoryTreeNode extends TreeNode implements vscode.TreeItem {
let hasMorePages = false;
let hasUnsearchedRepositories = false;
let needLogin = false;
const fetchNextPage = this.fetchNextPage;
this.fetchNextPage = false;
if (this.type === PRType.LocalPullRequest) {
try {
this.prs = (await this._prsTreeModel.getLocalPullRequests(this._folderRepoManager)).items;
@ -328,13 +330,13 @@ export class CategoryTreeNode extends TreeNode implements vscode.TreeItem {
let response: ItemsResponseResult<PullRequestModel>;
switch (this.type) {
case PRType.All:
response = await this._prsTreeModel.getAllPullRequests(this._folderRepoManager, this.fetchNextPage);
response = await this._prsTreeModel.getAllPullRequests(this._folderRepoManager, fetchNextPage);
break;
case PRType.Query:
response = await this._prsTreeModel.getPullRequestsForQuery(this._folderRepoManager, this.fetchNextPage, this._categoryQuery!);
response = await this._prsTreeModel.getPullRequestsForQuery(this._folderRepoManager, fetchNextPage, this._categoryQuery!);
break;
}
if (!this.fetchNextPage) {
if (!fetchNextPage) {
this.prs = response.items;
} else {
this.prs = this.prs.concat(response.items);
@ -353,8 +355,6 @@ export class CategoryTreeNode extends TreeNode implements vscode.TreeItem {
}
});
needLogin = e instanceof AuthenticationError;
} finally {
this.fetchNextPage = false;
}
}