From fd56103835086df95ece19cf232cf2d24db35c18 Mon Sep 17 00:00:00 2001 From: velz Date: Sat, 2 Aug 2025 12:41:59 +0530 Subject: [PATCH] FIX_CHATBOT_SW&URL --- app/Controllers/ChatbotControllerNew.php | 2 +- app/Views/chatbot.php | 2 +- service-worker.js | 7 ++++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/app/Controllers/ChatbotControllerNew.php b/app/Controllers/ChatbotControllerNew.php index e60e74ef..544c40d4 100644 --- a/app/Controllers/ChatbotControllerNew.php +++ b/app/Controllers/ChatbotControllerNew.php @@ -111,7 +111,7 @@ class ChatbotControllerNew extends BaseController log_message("error","Inside Bot Type Function"); $bot->types(); // Typing indicator for the first message - sleep(0.5); // Delay + sleep(0.1); // Delay }); // Start the Main Menu when user says "hi" or "start" $this->botman->hears('start|hi|hello|help|help me', function (BotMan $bot) { diff --git a/app/Views/chatbot.php b/app/Views/chatbot.php index cfcaae2e..5fd18fae 100644 --- a/app/Views/chatbot.php +++ b/app/Views/chatbot.php @@ -28,7 +28,7 @@ // chatServer: 'https://venbait.in/nhance/chatbot/chat', // frameEndpoint: 'https://venbait.in/nhance/chatbot/widget', chatServer: ``, - frameEndpoint: ``, + frameEndpoint: ``, title: "Ask ILA", placeholderText: "Type your message here...", aboutText: "Insurance Assistant ILA", diff --git a/service-worker.js b/service-worker.js index 349308f7..aa3577ae 100755 --- a/service-worker.js +++ b/service-worker.js @@ -12,10 +12,11 @@ self.addEventListener('activate', function(event) { // Fetch event self.addEventListener('fetch', function(event) { - // console.log('Fetching:', event.request.url); event.respondWith( - fetch(event.request).catch(function() { - return caches.match(event.request); + caches.match(event.request).then(function(response) { + // Respond with cached version or fetch from network + return response || fetch(event.request); }) ); }); +