interface: update state hooks to accomodate graph schema changes

This commit is contained in:
Tyler Brown Cifu Shuster 2021-03-09 10:58:49 -08:00
parent 5328aae1a6
commit 7161174ca5
3 changed files with 4 additions and 2 deletions

View File

@ -102,7 +102,7 @@ const mapifyChildren = (children) => {
}));
};
const pendingIndices = (json, state) => {
const pendingIndices = (json, state: GraphState): GraphState => {
const data = _.get(json, 'pending-indices', false);
if (data) {
Object.keys(data).forEach((key) => {

View File

@ -5,6 +5,7 @@ import { BaseState, createState } from "./base";
export interface GraphState extends BaseState<GraphState> {
graphs: Graphs;
graphKeys: Set<string>;
pendingIndices: Record<string, any>;
// getKeys: () => Promise<void>;
// getTags: () => Promise<void>;
// getTagQueries: () => Promise<void>;
@ -19,6 +20,7 @@ export interface GraphState extends BaseState<GraphState> {
const useGraphState = createState<GraphState>('Graph', {
graphs: {},
graphKeys: new Set(),
pendingIndices: {},
// getKeys: async () => {
// const api = useApi();
// const keys = await api.scry({

View File

@ -8,7 +8,7 @@ import { StoreState } from '~/logic/store/type';
import { RouteComponentProps } from 'react-router-dom';
import { LinkItem } from './components/LinkItem';
import { LinkWindow } from './LinkWindow';
import LinkWindow from './LinkWindow';
import { Comments } from '~/views/components/Comments';
import './css/custom.css';