Pull out getFromQueryToCompare
This commit is contained in:
@@ -592,12 +592,7 @@ export class QueryHistoryManager extends DisposableObject {
|
||||
);
|
||||
}
|
||||
|
||||
const fromItem =
|
||||
this.compareWithItem &&
|
||||
this.isSuccessfulCompletedLocalQueryInfo(this.compareWithItem) &&
|
||||
multiSelect.includes(this.compareWithItem)
|
||||
? this.compareWithItem
|
||||
: singleItem;
|
||||
const fromItem = this.getFromQueryToCompare(singleItem, multiSelect);
|
||||
|
||||
let toItem: CompletedLocalQueryInfo | undefined = undefined;
|
||||
try {
|
||||
@@ -1070,6 +1065,21 @@ export class QueryHistoryManager extends DisposableObject {
|
||||
}
|
||||
}
|
||||
|
||||
private getFromQueryToCompare(
|
||||
singleItem: CompletedLocalQueryInfo,
|
||||
multiSelect: CompletedLocalQueryInfo[],
|
||||
): CompletedLocalQueryInfo {
|
||||
if (
|
||||
this.compareWithItem &&
|
||||
this.isSuccessfulCompletedLocalQueryInfo(this.compareWithItem) &&
|
||||
multiSelect.includes(this.compareWithItem)
|
||||
) {
|
||||
return this.compareWithItem;
|
||||
} else {
|
||||
return singleItem;
|
||||
}
|
||||
}
|
||||
|
||||
private async findOtherQueryToCompare(
|
||||
fromItem: CompletedLocalQueryInfo,
|
||||
allItemsSelected: CompletedLocalQueryInfo[],
|
||||
|
||||
Reference in New Issue
Block a user