@docyrus/ui-pro-ai-assistant 0.4.0 → 0.4.1
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/dist/index.js +10 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -24873,12 +24873,16 @@ var DocyAssistant = ({
|
|
|
24873
24873
|
const { t } = useAssistantTranslation();
|
|
24874
24874
|
const agentStorageKey = `docyrus_agent_id_${tenantAiAgentId}`;
|
|
24875
24875
|
const deploymentStorageKey = `docyrus_deployment_id_${tenantAiAgentId}`;
|
|
24876
|
-
const
|
|
24877
|
-
|
|
24878
|
-
|
|
24879
|
-
|
|
24880
|
-
|
|
24881
|
-
|
|
24876
|
+
const resolveInitialAgentId = () => {
|
|
24877
|
+
if (tenantAiAgentId) return tenantAiAgentId;
|
|
24878
|
+
return localStorage.getItem(agentStorageKey) ?? tenantAiAgentId;
|
|
24879
|
+
};
|
|
24880
|
+
const resolveInitialDeploymentId = () => {
|
|
24881
|
+
if (tenantAiAgentId) return void 0;
|
|
24882
|
+
return localStorage.getItem(deploymentStorageKey) ?? void 0;
|
|
24883
|
+
};
|
|
24884
|
+
const [activeAgentId, setActiveAgentId] = useState(resolveInitialAgentId);
|
|
24885
|
+
const [deploymentId, setDeploymentId] = useState(resolveInitialDeploymentId);
|
|
24882
24886
|
const title = titleProp || "DocyAssistant";
|
|
24883
24887
|
const description = descriptionProp || t("descriptions.default");
|
|
24884
24888
|
const placeholder = placeholderProp || t("placeholders.type_message");
|