From 3b74e46a1092a7bdac8721ba82de887393a7ca9f Mon Sep 17 00:00:00 2001 From: Matilde Park Date: Thu, 13 May 2021 18:38:41 -0400 Subject: [PATCH] interface/logic/reducers: ts lint --- pkg/interface/src/logic/reducers/graph-update.ts | 4 +++- pkg/interface/src/logic/reducers/hark-update.ts | 8 ++++++++ pkg/interface/src/logic/reducers/launch-update.ts | 4 ++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/pkg/interface/src/logic/reducers/graph-update.ts b/pkg/interface/src/logic/reducers/graph-update.ts index b049119131..3b15bc56fe 100644 --- a/pkg/interface/src/logic/reducers/graph-update.ts +++ b/pkg/interface/src/logic/reducers/graph-update.ts @@ -71,6 +71,7 @@ const addGraph = (json, state: GraphState): GraphState => { const data = _.get(json, 'add-graph', false); if (data) { if (!('graphs' in state)) { + // @ts-ignore investigate zustand types state.graphs = {}; } @@ -91,6 +92,7 @@ const removeGraph = (json, state: GraphState): GraphState => { const data = _.get(json, 'remove-graph', false); if (data) { if (!('graphs' in state)) { + // @ts-ignore investigate zustand types state.graphs = {}; } const resource = data.ship + '/' + data.name; @@ -248,7 +250,7 @@ const removePosts = (json, state: GraphState): GraphState => { } else { const child = graph.get(index[0]); if (child) { - return graph.set(index[0], produce((draft) => { + return graph.set(index[0], produce((draft: any) => { draft.children = _remove(draft.children, index.slice(1)); })); } diff --git a/pkg/interface/src/logic/reducers/hark-update.ts b/pkg/interface/src/logic/reducers/hark-update.ts index faa4a3c66a..3fca58261c 100644 --- a/pkg/interface/src/logic/reducers/hark-update.ts +++ b/pkg/interface/src/logic/reducers/hark-update.ts @@ -20,18 +20,26 @@ export const HarkReducer = (json: any) => { const graphHookData = _.get(json, 'hark-graph-hook-update', false); if (graphHookData) { reduceState(useHarkState, graphHookData, [ + // @ts-ignore investigate zustand types graphInitial, + // @ts-ignore investigate zustand types graphIgnore, + // @ts-ignore investigate zustand types graphListen, + // @ts-ignore investigate zustand types graphWatchSelf, + // @ts-ignore investigate zustand types graphMentions ]); } const groupHookData = _.get(json, 'hark-group-hook-update', false); if (groupHookData) { reduceState(useHarkState, groupHookData, [ + // @ts-ignore investigate zustand types groupInitial, + // @ts-ignore investigate zustand types groupListen, + // @ts-ignore investigate zustand types groupIgnore ]); } diff --git a/pkg/interface/src/logic/reducers/launch-update.ts b/pkg/interface/src/logic/reducers/launch-update.ts index 441a3b0a05..2046733434 100644 --- a/pkg/interface/src/logic/reducers/launch-update.ts +++ b/pkg/interface/src/logic/reducers/launch-update.ts @@ -20,6 +20,7 @@ export default class LaunchReducer { const weatherData: WeatherState | boolean | Record = _.get(json, 'weather', false); if (weatherData) { useLaunchState.getState().set((state) => { + // @ts-ignore investigate zustand types state.weather = weatherData; }); } @@ -27,6 +28,7 @@ export default class LaunchReducer { const locationData = _.get(json, 'location', false); if (locationData) { useLaunchState.getState().set((state) => { + // @ts-ignore investigate zustand types state.userLocation = locationData; }); } @@ -34,6 +36,7 @@ export default class LaunchReducer { const baseHash = _.get(json, 'baseHash', false); if (baseHash) { useLaunchState.getState().set((state) => { + // @ts-ignore investigate zustand types state.baseHash = baseHash; }); } @@ -41,6 +44,7 @@ export default class LaunchReducer { const runtimeLag = _.get(json, 'runtimeLag', null); if (runtimeLag !== null) { useLaunchState.getState().set(state => { + // @ts-ignore investigate zustand types state.runtimeLag = runtimeLag; }); }