diff --git a/src/redux/node/reducer.ts b/src/redux/node/reducer.ts index d4512cb4..23fba7fb 100644 --- a/src/redux/node/reducer.ts +++ b/src/redux/node/reducer.ts @@ -1,14 +1,13 @@ -import uuid from 'uuid4'; import { createReducer } from '~/utils/reducer'; -import { INode } from '../types'; -import { EMPTY_BLOCK, EMPTY_NODE } from './constants'; +import { INode, IComment } from '../types'; +import { EMPTY_NODE } from './constants'; import { NODE_HANDLERS } from './handlers'; -import { EMPTY_FILE } from '../uploads/constants'; export type INodeState = Readonly<{ is_loading: boolean; editor: INode; - current: INode; + current: Partial; + comments: IComment[]; error: string; errors: Record; }>; @@ -20,7 +19,8 @@ const INITIAL_STATE: INodeState = { blocks: [], files: [], }, - current: null, + current: {}, + comments: [], is_loading: false, error: null, errors: {}, diff --git a/src/redux/types.ts b/src/redux/types.ts index 0be1d2de..8a0d4a22 100644 --- a/src/redux/types.ts +++ b/src/redux/types.ts @@ -113,6 +113,10 @@ export interface INode { updatedAt?: string; } +export interface IComment { + text: string; +} + export type IUploadProgressHandler = (progress: ProgressEvent) => void; export type IError = ValueOf; export type IValidationErrors = Record;