mirror of
https://github.com/cudr/slate-collaborative.git
synced 2025-06-13 12:54:04 +00:00
fix: splice is not a function error
This commit is contained in:
parent
c2066ed498
commit
b47c408919
@ -57,14 +57,10 @@ const opRemove = (op: Automerge.Diff, [map, ops]: any) => {
|
||||
try {
|
||||
const { index, path, obj, type } = op
|
||||
|
||||
// early return if no map obj available
|
||||
if (!map) {
|
||||
return [map, ops]
|
||||
}
|
||||
|
||||
if (
|
||||
map.hasOwnProperty(obj) &&
|
||||
typeof map[obj] !== 'string' &&
|
||||
map[obj].splice &&
|
||||
type !== 'text'
|
||||
) {
|
||||
map[obj].splice(index, 1)
|
||||
|
Loading…
Reference in New Issue
Block a user