mirror of
https://github.com/jeffvli/feishin.git
synced 2026-06-15 16:04:19 +02:00
normalize controls onto lists
This commit is contained in:
@@ -13,9 +13,9 @@ export type ItemListAction =
|
||||
| { type: 'CLEAR_SELECTED' };
|
||||
|
||||
export interface ItemListItem {
|
||||
_serverId: string;
|
||||
id: string;
|
||||
itemType: LibraryItem;
|
||||
serverId: string;
|
||||
}
|
||||
|
||||
export interface ItemListState {
|
||||
@@ -81,6 +81,8 @@ export const itemListReducer = (state: ItemListState, action: ItemListAction): I
|
||||
const newExpanded = new Set<string>();
|
||||
const newExpandedItems = new Map<string, ItemListItem>();
|
||||
|
||||
console.log('SET_EXPANDED', action.payload);
|
||||
|
||||
if (action.payload.length > 0) {
|
||||
const firstItem = action.payload[0];
|
||||
newExpanded.add(firstItem.id);
|
||||
@@ -158,9 +160,6 @@ export const itemListReducer = (state: ItemListState, action: ItemListAction): I
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Initial state for item grid
|
||||
*/
|
||||
export const initialItemListState: ItemListState = {
|
||||
expanded: new Set(),
|
||||
expandedItems: new Map(),
|
||||
|
||||
Reference in New Issue
Block a user