Skip to content
Snippets Groups Projects
Commit e71da4e3 authored by chris's avatar chris
Browse files

don't track certain events

parent e3d2b60f
No related branches found
No related tags found
1 merge request!107Tracked transaction
......@@ -24,9 +24,7 @@ const markDeletion = (tr, from, to, user, date1, date10) => {
node.isInline &&
node.marks.find(
mark =>
mark.type.name === "insertion" &&
mark.attrs.user === user.userId &&
!mark.attrs.approved
mark.type.name === "insertion" && mark.attrs.user === user.userId
)
) {
const removeStep = new ReplaceStep(
......
......@@ -20,7 +20,18 @@ import markInsertion from "./markInsertion";
import markWrapping from "./markWrapping";
const trackedTransaction = (tr, state, user) => {
console.log("user", user);
if (
!tr.steps.length ||
(tr.meta &&
!Object.keys(tr.meta).every(metadata =>
["inputType", "uiEvent", "paste"].includes(metadata)
)) ||
// don't replace history TRs
["historyUndo", "historyRedo"].includes(tr.getMeta("inputType"))
) {
return tr;
}
const approved = false;
const newTr = state.tr,
map = new Mapping(),
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment