Skip to content

Let's use AI to Earn!

feat: 评论通知

yikaJasonMic80c36306bc16
diff --git a/commont/UtilsEnum.ts b/commont/UtilsEnum.ts
index 544da7c3..95fded8b 100644
--- a/commont/UtilsEnum.ts
+++ b/commont/UtilsEnum.ts
@@ -1,7 +1,16 @@
+/*
+ * @Author: nevin
+ * @Date: 2025-03-01 19:27:31
+ * @LastEditTime: 2025-03-23 11:46:42
+ * @LastEditors: nevin
+ * @Description: 工具枚举
+ */
// 发送消息的事件key
export enum SendChannelEnum {
// 账户登录或更新
AccountLoginFinish = 'AccountLoginFinish',
// 视频发布进度发送
VideoPublishProgress = 'VideoPublishProgress',
+ // 自动运行失败
+ AutoRunError = 'AutoRunError',
}
diff --git a/electron/main/autoRun/controller.ts b/electron/main/autoRun/controller.ts
index a2948070..29a3c35b 100644
--- a/electron/main/autoRun/controller.ts
+++ b/electron/main/autoRun/controller.ts
@@ -1,7 +1,7 @@
/*
* @Author: nevin
* @Date: 2025-01-20 22:02:54
- * @LastEditTime: 2025-03-23 09:59:57
+ * @LastEditTime: 2025-03-23 11:05:01
* @LastEditors: nevin
* @Description: autoRun AutoRun
*/
@@ -11,6 +11,8 @@ import { AutoRunType } from '../../db/models/autoRun';
import { getUserInfo } from '../user/comment';
import { EtEvent } from '../../global/event';
import { autoRunTypeEtTag, hasTriggered } from './comment';
+import windowOperate from '../../util/windowOperate';
+import { SendChannelEnum } from '../../../commont/UtilsEnum';
@Controller()
export class AutoRunController {
@@ -124,6 +126,7 @@ export class AutoRunController {
EtEvent.emit(tag, item);
}
} catch (error) {
+ windowOperate.sendRenderMsg(SendChannelEnum.AutoRunError, error);
console.error('Failed to sync accounts:', error);
}
}
diff --git a/src/icp/autoRun.ts b/src/icp/autoRun.ts
index 08c5d487..521037af 100644
--- a/src/icp/autoRun.ts
+++ b/src/icp/autoRun.ts
@@ -1,7 +1,7 @@
/*
* @Author: nevin
* @Date: 2025-01-23 15:48:14
- * @LastEditTime: 2025-03-20 20:28:02
+ * @LastEditTime: 2025-03-23 11:49:28
* @LastEditors: nevin
* @Description: 自动进程
*/
diff --git a/src/views/reply/index.tsx b/src/views/reply/index.tsx
index f5d8fa9f..e88e7b7b 100644
--- a/src/views/reply/index.tsx
+++ b/src/views/reply/index.tsx
@@ -1,7 +1,7 @@
/*
* @Author: nevin
* @Date: 2025-02-10 22:20:15
- * @LastEditTime: 2025-03-21 22:53:09
+ * @LastEditTime: 2025-03-23 11:55:30
* @LastEditors: nevin
* @Description: 评论页面 reply
*/
@@ -13,7 +13,7 @@ import {
icpCreateCommentList,
} from '@/icp/reply';
import { Avatar, Button, Card, Col, Row } from 'antd';
-import { useCallback, useRef, useState } from 'react';
+import { useCallback, useEffect, useRef, useState } from 'react';
import AccountSidebar from '../account/components/AccountSidebar/AccountSidebar';
import styles from './reply.module.scss';
import Meta from 'antd/es/card/Meta';
@@ -29,6 +29,12 @@ export default function Page() {
const Ref_AddAutoRun = useRef<AddAutoRunRef>(null);
const Ref_ReplyComment = useRef<ReplyCommentRef>(null);
+ useEffect(() => {
+ const e = window.ipcRenderer.on('AutoRunError', (e, args) => {
+ // window.ipcRenderer.off('AutoRunError', e);
+ });
+ }, []);
+
async function getCreatorList() {
if (activeAccountId === -1) {
return;