llmasaservice-ui 0.9.5 → 0.9.6

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
@@ -500,22 +500,24 @@ var ChatPanel = ({
500
500
  }
501
501
  if (needsUpdate) {
502
502
  ensureConversation().then((convId) => {
503
- console.log(
504
- "updating conversation with customer id and email",
505
- convId,
506
- currentCustomer
507
- );
508
- const r = fetch(`${publicAPIUrl}/conversations/${convId}`, {
509
- method: "POST",
510
- headers: {
511
- "Content-Type": "application/json"
512
- },
513
- body: JSON.stringify({
514
- project_id: project_id != null ? project_id : "",
515
- customerId: updatedValues.customer_id,
516
- customerEmail: updatedValues.customer_user_email
517
- })
518
- });
503
+ if (convId && convId !== "") {
504
+ console.log(
505
+ "updating conversation with customer id and email",
506
+ convId,
507
+ currentCustomer
508
+ );
509
+ const r = fetch(`${publicAPIUrl}/conversations/${convId}`, {
510
+ method: "POST",
511
+ headers: {
512
+ "Content-Type": "application/json"
513
+ },
514
+ body: JSON.stringify({
515
+ project_id: project_id != null ? project_id : "",
516
+ customerId: updatedValues.customer_id,
517
+ customerEmail: updatedValues.customer_user_email
518
+ })
519
+ });
520
+ }
519
521
  });
520
522
  setCurrentCustomer(updatedValues);
521
523
  }
package/dist/index.mjs CHANGED
@@ -466,22 +466,24 @@ var ChatPanel = ({
466
466
  }
467
467
  if (needsUpdate) {
468
468
  ensureConversation().then((convId) => {
469
- console.log(
470
- "updating conversation with customer id and email",
471
- convId,
472
- currentCustomer
473
- );
474
- const r = fetch(`${publicAPIUrl}/conversations/${convId}`, {
475
- method: "POST",
476
- headers: {
477
- "Content-Type": "application/json"
478
- },
479
- body: JSON.stringify({
480
- project_id: project_id != null ? project_id : "",
481
- customerId: updatedValues.customer_id,
482
- customerEmail: updatedValues.customer_user_email
483
- })
484
- });
469
+ if (convId && convId !== "") {
470
+ console.log(
471
+ "updating conversation with customer id and email",
472
+ convId,
473
+ currentCustomer
474
+ );
475
+ const r = fetch(`${publicAPIUrl}/conversations/${convId}`, {
476
+ method: "POST",
477
+ headers: {
478
+ "Content-Type": "application/json"
479
+ },
480
+ body: JSON.stringify({
481
+ project_id: project_id != null ? project_id : "",
482
+ customerId: updatedValues.customer_id,
483
+ customerEmail: updatedValues.customer_user_email
484
+ })
485
+ });
486
+ }
485
487
  });
486
488
  setCurrentCustomer(updatedValues);
487
489
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "llmasaservice-ui",
3
- "version": "0.9.5",
3
+ "version": "0.9.6",
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
@@ -510,23 +510,25 @@ const ChatPanel: React.FC<ChatPanelProps & ExtraProps> = ({
510
510
  if (needsUpdate) {
511
511
  // update the customer id and email in the conversation
512
512
  ensureConversation().then((convId) => {
513
- console.log(
514
- "updating conversation with customer id and email",
515
- convId,
516
- currentCustomer
517
- );
513
+ if (convId && convId !== "") {
514
+ console.log(
515
+ "updating conversation with customer id and email",
516
+ convId,
517
+ currentCustomer
518
+ );
518
519
 
519
- const r = fetch(`${publicAPIUrl}/conversations/${convId}`, {
520
- method: "POST",
521
- headers: {
522
- "Content-Type": "application/json",
523
- },
524
- body: JSON.stringify({
525
- project_id: project_id ?? "",
526
- customerId: updatedValues.customer_id,
527
- customerEmail: updatedValues.customer_user_email,
528
- }),
529
- });
520
+ const r = fetch(`${publicAPIUrl}/conversations/${convId}`, {
521
+ method: "POST",
522
+ headers: {
523
+ "Content-Type": "application/json",
524
+ },
525
+ body: JSON.stringify({
526
+ project_id: project_id ?? "",
527
+ customerId: updatedValues.customer_id,
528
+ customerEmail: updatedValues.customer_user_email,
529
+ }),
530
+ });
531
+ }
530
532
  });
531
533
 
532
534
  setCurrentCustomer(updatedValues);