mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-15 18:12:47 +03:00
interface: update state hooks to accomodate graph schema changes
This commit is contained in:
parent
5328aae1a6
commit
7161174ca5
@ -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) => {
|
||||||
|
@ -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({
|
||||||
|
@ -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';
|
||||||
|
Loading…
Reference in New Issue
Block a user