From 845484aecc0149f427452c39c51a80a47a8cb748 Mon Sep 17 00:00:00 2001 From: lissitz <53315888+lissitz@users.noreply.github.com> Date: Tue, 28 Jan 2020 16:44:34 +0100 Subject: [PATCH] =?UTF-8?q?Fix:=20refreshing=20the=20page=20while=20select?= =?UTF-8?q?ing=20saves=20the=20selection=20ele=E2=80=A6=20(#601)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix: refreshing the page while selecting saves the selection element Fixes #591. * fix lint Co-authored-by: David Luzar --- src/index.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/index.tsx b/src/index.tsx index 8731bcac..c37ed15b 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -1494,7 +1494,10 @@ export class App extends React.Component { } private saveDebounced = debounce(() => { - saveToLocalStorage(elements, this.state); + saveToLocalStorage( + elements.filter(x => x.type !== "selection"), + this.state, + ); }, 300); componentDidUpdate() {