a tool for shared writing and social publishing
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

debounce are you sure deletions

+11
+11
components/Blocks/useBlockKeyboardHandlers.ts
··· 114 114 if (!prevBlock) return; 115 115 } 116 116 117 + let debounced: null | number = null; 117 118 async function Backspace({ 118 119 e, 119 120 props, ··· 140 141 // ...and areYouSure state is false, set it to true 141 142 if (!areYouSure) { 142 143 setAreYouSure(true); 144 + debounced = window.setTimeout(() => { 145 + debounced = null; 146 + }, 300); 143 147 return; 144 148 } 145 149 // ... and areYouSure state is true, ··· 147 151 // if there is a page to close, close it and remove the block 148 152 if (areYouSure) { 149 153 e.preventDefault(); 154 + if (debounced) { 155 + window.clearTimeout(debounced); 156 + debounced = window.setTimeout(() => { 157 + debounced = null; 158 + }, 300); 159 + return; 160 + } 150 161 return deleteBlock([props.entityID].flat(), rep); 151 162 } 152 163 }