@lvce-editor/file-system-worker 1.19.0 → 1.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1325,16 +1325,24 @@ const unregisterWatchCallback = id => {
1325
1325
  delete watchCallbacks[id];
1326
1326
  };
1327
1327
 
1328
- const watchFile = async (id, uri, rpc) => {
1328
+ const watchFile = async (id, uri, rpcId) => {
1329
1329
  const commandId = 'Output.executeWatchCallback';
1330
1330
  registerWatchCallback(id, async () => {
1331
- await rpc.invoke(commandId);
1331
+ const rpc = get(rpcId);
1332
+ if (!rpc) {
1333
+ return;
1334
+ }
1335
+ await rpc.invoke(commandId, id);
1332
1336
  });
1333
1337
  // @ts-ignore
1334
1338
  await invoke('FileSystem.watchFile', id, uri);
1335
1339
  };
1336
1340
  const executeWatchCallback = async id => {
1337
- await executeWatchCallBack(id);
1341
+ try {
1342
+ await executeWatchCallBack(id);
1343
+ } catch (error) {
1344
+ console.error(error);
1345
+ }
1338
1346
  };
1339
1347
  const unwatchFile = async id => {
1340
1348
  unregisterWatchCallback(id);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/file-system-worker",
3
- "version": "1.19.0",
3
+ "version": "1.21.0",
4
4
  "description": "File System Worker",
5
5
  "keywords": [
6
6
  "Lvce Editor"