From 94dee121affd17697cd7f14eda22d4d09a25ea83 Mon Sep 17 00:00:00 2001 From: john <johnbarlas39@gmail.com> Date: Thu, 20 Apr 2017 20:04:25 +0300 Subject: [PATCH] use patches for chapter alignment updates --- app/components/BookBuilder/Chapter/AlignmentBox.jsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/components/BookBuilder/Chapter/AlignmentBox.jsx b/app/components/BookBuilder/Chapter/AlignmentBox.jsx index 19d98f0..f67dc85 100644 --- a/app/components/BookBuilder/Chapter/AlignmentBox.jsx +++ b/app/components/BookBuilder/Chapter/AlignmentBox.jsx @@ -14,8 +14,14 @@ class AlignmentBox extends React.Component { if (!includes(['left', 'right'], position)) return - chapter.alignment[position] = !chapter.alignment[position] - update(chapter) + const patch = { + alignment: chapter.alignment, + id: chapter.id + } + + patch.alignment[position] = !chapter.alignment[position] + + update(patch) } render () { -- GitLab