fix: bugs

This commit is contained in:
Eric Maciel 2020-10-27 14:29:56 -04:00
parent a9b20ae99d
commit 0cce4b4865
2 changed files with 2 additions and 2 deletions

View File

@ -12,7 +12,7 @@ import { getClients } from './utils'
import AutomergeBackend from './AutomergeBackend'
export interface SocketIOCollaborationOptions {
entry: number | Server
entry: Server
connectOpts?: SocketIO.ServerOptions
defaultValue?: Node[]
saveFrequency?: number

View File

@ -19,7 +19,7 @@ const removeTextOp = (op: Automerge.Diff) => (map: any, doc: Element) => {
if (typeof index !== 'number') return
const text = node?.text[index] || '*'
const text = node?.text?.[index] || '*'
if (node) {
node.text = node.text?.slice(0, index) + node.text?.slice(index + 1)