瀏覽代碼

Fix: refreshing the page while selecting saves the selection ele… (#601)

* Fix: refreshing the page while selecting saves the selection element

Fixes #591.

* fix lint

Co-authored-by: David Luzar <luzar.david@gmail.com>
lissitz 5 年之前
父節點
當前提交
845484aecc
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      src/index.tsx

+ 4 - 1
src/index.tsx

@@ -1494,7 +1494,10 @@ export class App extends React.Component<any, AppState> {
   }
 
   private saveDebounced = debounce(() => {
-    saveToLocalStorage(elements, this.state);
+    saveToLocalStorage(
+      elements.filter(x => x.type !== "selection"),
+      this.state,
+    );
   }, 300);
 
   componentDidUpdate() {