Rename calculateNewExpandedState -> updateItemInExpandedState

This commit is contained in:
Charis Kyriakou 2023-01-04 09:06:31 +00:00
Родитель 1a08ae4df2
Коммит f3d0773085
3 изменённых файлов: 8 добавлений и 8 удалений

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

@ -31,7 +31,7 @@ export interface RemoteUserDefinedListExpandedDbItem {
listName: string;
}
export function calculateNewExpandedState(
export function updateItemInExpandedState(
currentExpandedItems: ExpandedDbItem[],
dbItem: DbItem,
itemExpanded: boolean,

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

@ -3,7 +3,7 @@ import { AppEvent, AppEventEmitter } from "../common/events";
import { ValueResult } from "../common/value-result";
import { DbConfigStore } from "./config/db-config-store";
import { DbItem, DbListKind } from "./db-item";
import { calculateNewExpandedState, ExpandedDbItem } from "./db-item-expansion";
import { updateItemInExpandedState, ExpandedDbItem } from "./db-item-expansion";
import {
getSelectedDbItem,
mapDbItemToSelectedDbItem,
@ -74,7 +74,7 @@ export class DbManager {
const currentExpandedItems = this.getCurrentExpandedItems();
const newExpandedItems = calculateNewExpandedState(
const newExpandedItems = updateItemInExpandedState(
currentExpandedItems,
dbItem,
itemExpanded,

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

@ -3,7 +3,7 @@ import {
RootRemoteDbItem,
} from "../../../src/databases/db-item";
import {
calculateNewExpandedState,
updateItemInExpandedState,
ExpandedDbItem,
ExpandedDbItemKind,
} from "../../../src/databases/db-item-expansion";
@ -29,7 +29,7 @@ describe("db item expansion", () => {
listName: "list2",
});
const newExpandedItems = calculateNewExpandedState(
const newExpandedItems = updateItemInExpandedState(
currentExpandedItems,
dbItem,
true,
@ -50,7 +50,7 @@ describe("db item expansion", () => {
listName: "list2",
});
const newExpandedItems = calculateNewExpandedState([], dbItem, true);
const newExpandedItems = updateItemInExpandedState([], dbItem, true);
expect(newExpandedItems).toEqual([
{
@ -76,7 +76,7 @@ describe("db item expansion", () => {
listName: "list1",
});
const newExpandedItems = calculateNewExpandedState(
const newExpandedItems = updateItemInExpandedState(
currentExpandedItems,
dbItem,
false,
@ -98,7 +98,7 @@ describe("db item expansion", () => {
const dbItem: RootRemoteDbItem = createRootRemoteDbItem();
const newExpandedItems = calculateNewExpandedState(
const newExpandedItems = updateItemInExpandedState(
currentExpandedItems,
dbItem,
false,