File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -481,7 +481,7 @@ function App() {
481481 )
482482 handleEditorChange ( errorVal )
483483 } )
484- } catch ( err : Error | unknown ) {
484+ } catch ( err : unknown ) {
485485 const docStr = view . state . doc . toString ( )
486486 const errorVal = docStr . replace (
487487 '\n\u200B...\u200C\n' ,
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ export function useVariables() {
77
88 // Sync global variables whenever notes change
99 useEffect ( ( ) => {
10+ let abort = false
1011 async function syncVars ( ) {
1112 const globals : Record < string , unknown > = { }
1213 const reVar = / ^ \/ g l o b v a r \s + ( [ a - z A - Z 0 - 9 _ ] + ) \s * = \s * ( .* ) $ / gm
@@ -27,9 +28,13 @@ export function useVariables() {
2728 }
2829 }
2930 }
31+ if ( abort ) return
3032 ; ( window as unknown as { __globalVariables : Record < string , unknown > } ) . __globalVariables =
3133 globals
3234 }
3335 syncVars ( )
36+ return ( ) => {
37+ abort = true
38+ }
3439 } , [ notes ] )
3540}
You can’t perform that action at this time.
0 commit comments