Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

feat: expose markUserValidAction business interface

YuTengjingd257a06887b6
diff --git a/src/business/client/markUserValidAction.ts b/src/business/client/markUserValidAction.ts
new file mode 100644
index 00000000000..db58acf60bf
--- /dev/null
+++ b/src/business/client/markUserValidAction.ts
@@ -0,0 +1 @@
+export const markUserValidAction = async () => {};
diff --git a/src/store/chat/slices/aiChat/actions/conversationLifecycle.ts b/src/store/chat/slices/aiChat/actions/conversationLifecycle.ts
index 308d9bdf187..034c29afe7e 100644
--- a/src/store/chat/slices/aiChat/actions/conversationLifecycle.ts
+++ b/src/store/chat/slices/aiChat/actions/conversationLifecycle.ts
@@ -1,5 +1,6 @@
/* eslint-disable sort-keys-fix/sort-keys-fix, typescript-sort-keys/interface */
// Disable the auto sort key eslint rule to make the code more logic and readable
+import { ENABLE_BUSINESS_FEATURES } from '@lobechat/business-const';
import { LOADING_FLAT } from '@lobechat/const';
import {
type ChatImageItem,
@@ -13,6 +14,7 @@ import { TRPCClientError } from '@trpc/client';
import { t } from 'i18next';
import { type StateCreator } from 'zustand/vanilla';
+import { markUserValidAction } from '@/business/client/markUserValidAction';
import { aiChatService } from '@/services/aiChat';
import { getAgentStoreState } from '@/store/agent';
import { agentSelectors } from '@/store/agent/selectors';
@@ -303,6 +305,10 @@ export const conversationLifecycle: StateCreator<
get().updateOperationMetadata(operationId, { inputEditorTempState: null });
}
+ if (ENABLE_BUSINESS_FEATURES) {
+ markUserValidAction();
+ }
+
if (!data) return;
if (data.topicId) get().internal_updateTopicLoading(data.topicId, true);
diff --git a/src/store/image/slices/createImage/action.ts b/src/store/image/slices/createImage/action.ts
index 1eaa1854e7f..f794723d299 100644
--- a/src/store/image/slices/createImage/action.ts
+++ b/src/store/image/slices/createImage/action.ts
@@ -1,5 +1,7 @@
+import { ENABLE_BUSINESS_FEATURES } from '@lobechat/business-const';
import { type StateCreator } from 'zustand';
+import { markUserValidAction } from '@/business/client/markUserValidAction';
import { imageService } from '@/services/image';
import { type ImageStore } from '../../store';
@@ -72,6 +74,10 @@ export const createCreateImageSlice: StateCreator<
set({ isCreatingWithNewTopic: true }, false, 'createImage/startCreateImageWithNewTopic');
}
+ if (ENABLE_BUSINESS_FEATURES) {
+ markUserValidAction();
+ }
+
// 5. Create image via service
await imageService.createImage({
generationTopicId: finalTopicId!,