@plasosdk/plaso-electron-sdk 1.2.2 → 1.2.4

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.
package/js/render.js CHANGED
@@ -212,19 +212,19 @@ function createClassWindow(classWindowProps) {
212
212
 
213
213
  /**---------------------------------------------------- 创建课堂/备课窗口-----------------------------------*/
214
214
 
215
- const onClassWindowReady = () => {
215
+ const onClassWindowReady = (event) => {
216
216
  const classWindow = remote.BrowserWindow.formId(currentWinId);
217
217
  classWindow.moveTop();
218
218
  classWindow.focus();
219
219
  logger.info(`课堂窗口ready,id:${currentWinId}`);
220
220
  if (onClassWindowReadyFn && currentWinId) onClassWindowReadyFn(currentWinId);
221
221
  };
222
- const onClassFinished = (value) => {
222
+ const onClassFinished = (event, value) => {
223
223
  const meetingId = value?.meetingId;
224
224
  logger.info(`课堂已结束,id:${currentWinId}, meetingId is ${meetingId}`);
225
225
  if (onClassFinishedFn && currentWinId) onClassFinishedFn(meetingId);
226
226
  };
227
- const onClassHtmlReady = (_, value) => {
227
+ const onClassHtmlReady = (event, value) => {
228
228
  const webContentId = value?.webContentId ?? currentWinId;
229
229
  currentWinId = webContentId;
230
230
  logger.info(`课堂窗口 html ready,id:${currentWinId}`);
@@ -232,7 +232,7 @@ function createClassWindow(classWindowProps) {
232
232
  if (webContentId)
233
233
  ipcRenderer.sendTo(webContentId, CLASS_WINDOW_MESG_TYPE.INIT_CLASS_OPTIONS, classOptionsObj);
234
234
  };
235
- const onSaveBoard = (_, value) => {
235
+ const onSaveBoard = (event, value) => {
236
236
  logger.info(`保存板书:${JSON.stringify(value)}`);
237
237
  const cb = (value) => {
238
238
  if (currentWinId) ipcRenderer.sendTo(currentWinId, CLASS_WINDOW_MESG_TYPE.RESP_SAVE_BOARD, value);
@@ -240,11 +240,11 @@ function createClassWindow(classWindowProps) {
240
240
  if (onSaveBoardFn && value) onSaveBoardFn(value, cb);
241
241
  };
242
242
 
243
- const onOpenResourceCenter = () => {
243
+ const onOpenResourceCenter = (event) => {
244
244
  if (onOpenResourceCenterFn) onOpenResourceCenterFn();
245
245
  };
246
246
 
247
- const onGetExtFileName = async (info) => {
247
+ const onGetExtFileName = async (event, info) => {
248
248
  if (onGetExtFileNameFn && info) {
249
249
  const url = await onGetExtFileNameFn(info);
250
250
  if (url) {
@@ -356,13 +356,12 @@ function createPrepareClassWindow(prepareClassWindowProps) {
356
356
  * @property {string} [url] 文件的可下载地址
357
357
  */
358
358
  /**
359
- * @param {string | number} winId 课堂id
360
359
  * @param {fileDataObj} fileData 文件数据
361
360
  */
362
- function insertObject(webContentId, fileData) {
361
+ function insertObject(fileData) {
363
362
  try {
364
363
  const { ipcRenderer } = window.require('electron');
365
- if (webContentId) ipcRenderer.sendTo(webContentId, CLASS_WINDOW_MESG_TYPE.INSERT_OBJECT, fileData);
364
+ if (currentWinId) ipcRenderer.sendTo(currentWinId, CLASS_WINDOW_MESG_TYPE.INSERT_OBJECT, fileData);
366
365
  } catch (error) {
367
366
  logger.error(`insertObject error is: ${JSON.stringify(error)}}`);
368
367
  return ERROR_CODE.COMMOM_ERROR;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plasosdk/plaso-electron-sdk",
3
- "version": "1.2.2",
3
+ "version": "1.2.4",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -148,7 +148,7 @@ const downloadFile = (zipFileName, localDir) => {
148
148
  zip.extractAllTo(localDir, true);
149
149
  }
150
150
  if (fs.existsSync(path.join(localDir, '__MACOSX'))) {
151
- fs.rmdir(path.join(localDir, '__MACOSX'));
151
+ fs.rmdir(path.join(localDir, '__MACOSX'), { recursive: true, force: true });
152
152
  }
153
153
  fs.unlink(localZipFilePath, () => {});
154
154
  logger.info(`文件${zipFileName}解压完成`);