Rename allItemsSelected => allSelectedItems

This commit is contained in:
Robert
2023-04-25 15:52:41 +01:00
parent 1a87ad8a33
commit ab7ec589ff

View File

@@ -1082,24 +1082,24 @@ export class QueryHistoryManager extends DisposableObject {
private async findOtherQueryToCompare( private async findOtherQueryToCompare(
fromItem: CompletedLocalQueryInfo, fromItem: CompletedLocalQueryInfo,
allItemsSelected: CompletedLocalQueryInfo[], allSelectedItems: CompletedLocalQueryInfo[],
): Promise<CompletedLocalQueryInfo | undefined> { ): Promise<CompletedLocalQueryInfo | undefined> {
const dbName = fromItem.initialInfo.databaseInfo.name; const dbName = fromItem.initialInfo.databaseInfo.name;
// If exactly 2 items are selected, return the one that // If exactly 2 items are selected, return the one that
// isn't being used as the "from" item. // isn't being used as the "from" item.
if (allItemsSelected.length === 2) { if (allSelectedItems.length === 2) {
const otherItem = const otherItem =
fromItem === allItemsSelected[0] fromItem === allSelectedItems[0]
? allItemsSelected[1] ? allSelectedItems[1]
: allItemsSelected[0]; : allSelectedItems[0];
if (otherItem.initialInfo.databaseInfo.name !== dbName) { if (otherItem.initialInfo.databaseInfo.name !== dbName) {
throw new Error("Query databases must be the same."); throw new Error("Query databases must be the same.");
} }
return otherItem; return otherItem;
} }
if (allItemsSelected.length > 2) { if (allSelectedItems.length > 2) {
throw new Error("Please select no more than 2 queries."); throw new Error("Please select no more than 2 queries.");
} }