@eshal-bot/chat-widget 0.1.46 → 0.1.47

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.
@@ -60081,6 +60081,21 @@
60081
60081
  // Handle X button: first click shows form, second click closes
60082
60082
  const handleCloseClick = reactExports.useCallback(() => {
60083
60083
  if (!isCsatEnabled) {
60084
+ // CSAT disabled: closing the chat should also clear out the
60085
+ // conversation, mirroring the post-CSAT clear in
60086
+ // handleResolveSubmission. Without this the X button only hides
60087
+ // the window while the old transcript persists in the session and
60088
+ // re-appears on reopen / reload. Route through onRefreshChat (same
60089
+ // entry point the kebab "Refresh Chat" uses) so any change to the
60090
+ // refresh path applies here too, and clear widgetFilter explicitly.
60091
+ if (onWidgetFilterChange) {
60092
+ onWidgetFilterChange(null);
60093
+ }
60094
+ if (onRefreshChat) {
60095
+ onRefreshChat();
60096
+ } else if (onResetConversation) {
60097
+ onResetConversation();
60098
+ }
60084
60099
  onClose === null || onClose === void 0 || onClose();
60085
60100
  return;
60086
60101
  }
@@ -60092,7 +60107,7 @@
60092
60107
  } else {
60093
60108
  onClose === null || onClose === void 0 || onClose();
60094
60109
  }
60095
- }, [isCsatEnabled, showResolveForm, isConversationResolved, onClose]);
60110
+ }, [isCsatEnabled, showResolveForm, isConversationResolved, onClose, onWidgetFilterChange, onRefreshChat, onResetConversation]);
60096
60111
  reactExports.useEffect(() => {
60097
60112
  if (isCsatEnabled) return;
60098
60113
  if (showResolveForm) setShowResolveForm(false);