Skip to content

Commit c6cc4ad

Browse files
Christopher StamperChristopher Stamper
authored andcommitted
updated ts
1 parent 8f7b11f commit c6cc4ad

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

src/app/FrontendTypes.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,16 @@ export interface CurrentTab {
171171
currBranch: number;
172172
currLocation: { [k: string]: any };
173173
currParent: number;
174-
hierarchy: { [k: string]: any };
174+
hierarchy: {
175+
stateSnapshot: {
176+
route: any;
177+
children: any[];
178+
};
179+
name: number;
180+
branch: number;
181+
index: number;
182+
children?: [];
183+
};
175184
index: number;
176185
intervalId: null | number;
177186
mode: { paused: boolean };

src/app/containers/ActionContainer.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import SwitchAppDropdown from '../components/SwitchApp';
55
import { emptySnapshots, changeView, changeSlider } from '../slices/mainSlice';
66
import { useDispatch, useSelector } from 'react-redux';
77
import RouteDescription from '../components/RouteDescription';
8-
import { ActionContainerProps, MainState, Obj, RootState } from '../FrontendTypes';
8+
import { ActionContainerProps, CurrentTab, MainState, Obj, RootState } from '../FrontendTypes';
99
import { Button, Switch } from '@mui/material';
1010

1111
/*
@@ -26,7 +26,7 @@ function ActionContainer(props: ActionContainerProps): JSX.Element {
2626
const dispatch = useDispatch();
2727
const { currentTab, tabs, port }: MainState = useSelector((state: RootState) => state.main);
2828

29-
const { currLocation, hierarchy, sliderIndex, viewIndex } = tabs[currentTab]; // we destructure the currentTab object
29+
const { currLocation, hierarchy, sliderIndex, viewIndex }: Partial<CurrentTab> = tabs[currentTab]; // we destructure the currentTab object
3030
const {
3131
toggleActionContainer, // function that handles Time Jump Sidebar view from MainContainer
3232
actionView, // local state declared in MainContainer
@@ -89,7 +89,7 @@ function ActionContainer(props: ActionContainerProps): JSX.Element {
8989
if (hierarchy) displayArray(hierarchy); // when page is refreshed we may not have a hierarchy so we need to check if hierarchy was initialized. If it was initialized, invoke displayArray to display the hierarchy
9090

9191
// This function allows us to use our arrow keys to jump between snapshots. It passes an event and the index of each action-component. Using the arrow keys allows us to highligh snapshots and the enter key jumps to the selected snapshot
92-
function handleOnKeyDown(e: KeyboardEvent, i: number): void {
92+
function handleOnKeyDown(e: Partial<KeyboardEvent>, i: number): void {
9393
let currIndex = i;
9494

9595
if (e.key === 'ArrowUp') {

0 commit comments

Comments
 (0)