File tree Expand file tree Collapse file tree 2 files changed +28
-4
lines changed
Expand file tree Collapse file tree 2 files changed +28
-4
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,12 @@ export function cleanModePlugins(client: Client) {
5555 // Propagate click event from checkbox
5656 void client . dispatchClickEvent ( clickEvent ) ;
5757 } ,
58+ onStateChange : ( pos , endPos , _oldState , newState ) => {
59+ client . editorView . dispatch ( {
60+ changes : { from : pos , to : endPos , insert : newState } ,
61+ } ) ;
62+ } ,
63+ client,
5864 } ) ,
5965 listBulletPlugin ( ) ,
6066 tablePlugin ( client ) ,
Original file line number Diff line number Diff line change @@ -7,12 +7,30 @@ export function syncSyscalls(client: Client): SysCallMapping {
77 "sync.hasInitialSyncCompleted" : ( ) : boolean => {
88 return client . fullSyncCompleted ;
99 } ,
10- "sync.performFileSync" : ( _ctx , path : string ) : Promise < void > => {
11- void client . postServiceWorkerMessage ( { type : "perform-file-sync" , path } ) ;
10+ "sync.performFileSync" : async ( _ctx , path : string ) : Promise < void > => {
11+ try {
12+ await client . postServiceWorkerMessage ( {
13+ type : "perform-file-sync" ,
14+ path,
15+ } ) ;
16+ } catch ( e : any ) {
17+ console . warn (
18+ "No service worker available, so sync is inactive" ,
19+ e . message ,
20+ ) ;
21+ return ;
22+ }
1223 return waitForServiceWorkerActivation ( path ) ;
1324 } ,
14- "sync.performSpaceSync" : ( ) : Promise < number > => {
15- void client . postServiceWorkerMessage ( { type : "perform-space-sync" } ) ;
25+ "sync.performSpaceSync" : async ( ) : Promise < number > => {
26+ try {
27+ await client . postServiceWorkerMessage ( {
28+ type : "perform-space-sync" ,
29+ } ) ;
30+ } catch ( e : any ) {
31+ console . warn ( "No service worker available, so sync is inactive" , e ) ;
32+ return 0 ;
33+ }
1634 return waitForServiceWorkerActivation ( ) ;
1735 } ,
1836 } ;
You can’t perform that action at this time.
0 commit comments