From 1eedd5e6098df1914a3decf197f0f850f1433078 Mon Sep 17 00:00:00 2001 From: overflowerror Date: Sun, 22 Aug 2021 17:09:33 +0200 Subject: [PATCH] feat: reordering tweets now works in frontend --- frontend/src/components/ThreadFormDialog/index.tsx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/ThreadFormDialog/index.tsx b/frontend/src/components/ThreadFormDialog/index.tsx index ff3cb10..a18337f 100644 --- a/frontend/src/components/ThreadFormDialog/index.tsx +++ b/frontend/src/components/ThreadFormDialog/index.tsx @@ -80,10 +80,19 @@ const Index: FunctionComponent = ( }} /> - { + { + if (!result.destination) { + return + } + + const tweet = thread.tweets.splice(result.source.index, 1) + thread.tweets.splice(result.destination!.index, 0, ...tweet) + setThread({ + ...thread + }) }}> - {(provided, snapshot) => ( + {(provided) => (