Spaces:
Running
Running
Update index.html
Browse files- 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!";
|