bobby191232 commited on
Commit
d03e2cc
·
verified ·
1 Parent(s): 4948968

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +6 -0
index.html CHANGED
@@ -152,6 +152,12 @@ const clearButton = document.getElementById("clearButton");
152
  button.addEventListener("click", sendMessage);
153
 
154
  clearButton.addEventListener("click", function() {
 
 
 
 
 
 
155
  chatHistory = [];
156
  localStorage.removeItem("myAIChatHistory");
157
  answer.textContent = "🗑️ Chat history cleared!";
 
152
  button.addEventListener("click", sendMessage);
153
 
154
  clearButton.addEventListener("click", function() {
155
+ const confirmed = confirm("Are you sure you want to clear your chat?");
156
+
157
+ if (!confirmed) {
158
+ return;
159
+ }
160
+
161
  chatHistory = [];
162
  localStorage.removeItem("myAIChatHistory");
163
  answer.textContent = "🗑️ Chat history cleared!";