瀏覽代碼

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>
vanilla_orig
lissitz 5 年之前
父節點
當前提交
845484aecc
共有 1 個檔案被更改,包括 4 行新增1 行删除
  1. 4
    1
      src/index.tsx

+ 4
- 1
src/index.tsx 查看文件

1494
   }
1494
   }
1495
 
1495
 
1496
   private saveDebounced = debounce(() => {
1496
   private saveDebounced = debounce(() => {
1497
-    saveToLocalStorage(elements, this.state);
1497
+    saveToLocalStorage(
1498
+      elements.filter(x => x.type !== "selection"),
1499
+      this.state,
1500
+    );
1498
   }, 300);
1501
   }, 300);
1499
 
1502
 
1500
   componentDidUpdate() {
1503
   componentDidUpdate() {

Loading…
取消
儲存