llmasaservice-ui 0.7.23 → 0.7.25

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 CHANGED
@@ -239,9 +239,12 @@ var ChatPanel = ({
239
239
  }, [idle]);
240
240
  (0, import_react3.useEffect)(() => {
241
241
  if (Object.keys(initialHistory).length === 0) return;
242
- console.log("initialHistory", initialHistory);
243
242
  setHistory(initialHistory);
244
243
  }, [initialHistory]);
244
+ (0, import_react3.useEffect)(() => {
245
+ if (!conversation || conversation === "") return;
246
+ setHistory(initialHistory);
247
+ }, [conversation]);
245
248
  (0, import_react3.useEffect)(() => {
246
249
  const handleBeforeUnload = (event) => {
247
250
  if (callToActionMustSendEmail && showCallToAction && callToActionEmailAddress && callToActionEmailAddress !== "" && !hasSentCallToActionEmail) {
package/dist/index.mjs CHANGED
@@ -205,9 +205,12 @@ var ChatPanel = ({
205
205
  }, [idle]);
206
206
  useEffect(() => {
207
207
  if (Object.keys(initialHistory).length === 0) return;
208
- console.log("initialHistory", initialHistory);
209
208
  setHistory(initialHistory);
210
209
  }, [initialHistory]);
210
+ useEffect(() => {
211
+ if (!conversation || conversation === "") return;
212
+ setHistory(initialHistory);
213
+ }, [conversation]);
211
214
  useEffect(() => {
212
215
  const handleBeforeUnload = (event) => {
213
216
  if (callToActionMustSendEmail && showCallToAction && callToActionEmailAddress && callToActionEmailAddress !== "" && !hasSentCallToActionEmail) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "llmasaservice-ui",
3
- "version": "0.7.23",
3
+ "version": "0.7.25",
4
4
  "description": "Prebuilt UI components for LLMAsAService.io",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
package/src/ChatPanel.tsx CHANGED
@@ -160,12 +160,15 @@ const ChatPanel: React.FC<ChatPanelProps & ExtraProps> = ({
160
160
 
161
161
  useEffect(() => {
162
162
  if (Object.keys(initialHistory).length === 0) return;
163
-
164
- console.log("initialHistory", initialHistory);
165
163
  setHistory(initialHistory);
166
164
 
167
165
  }, [initialHistory]);
168
166
 
167
+ useEffect(() => {
168
+ if (!conversation || conversation === "") return;
169
+ setHistory(initialHistory);
170
+ }, [conversation]);
171
+
169
172
  useEffect(() => {
170
173
  const handleBeforeUnload = (event: BeforeUnloadEvent) => {
171
174
  if (