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); const data = _.get(json, 'pending-indices', false);
if (data) { if (data) {
Object.keys(data).forEach((key) => { Object.keys(data).forEach((key) => {

View File

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

View File

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