Skip to content

Commit

Permalink
USAGOV-2014-Display-Call-Times: Get chat time as well
Browse files Browse the repository at this point in the history
  • Loading branch information
IsabelLaurenceau committed Oct 30, 2024
1 parent fd693aa commit 961da72
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions web/themes/custom/usagov/scripts/callCenterWaitTimeLookup.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,18 @@ jQuery(document).ready(async function () {
"type": "GET",
"dataType": "json",
"success": function (response) {
if (jQuery("html[lang|='en']").length) {
if (window.location.pathname === "/phone") {
jsonSeconds = response.call.estimatedWaitTimeSeconds.en;
}
if (jQuery("html[lang|='es']").length) {
else if (window.location.pathname === "/es/llamenos") {
jsonSeconds = response.call.estimatedWaitTimeSeconds.sp;
}
else if (window.location.pathname === "/chat") {
jsonSeconds = response.chat.estimatedWaitTimeSeconds.en;
}
else (window.location.pathname === "/es/chat") {
jsonSeconds = response.chat.estimatedWaitTimeSeconds.sp;
}

jsonTimestamp = response.timestamp;
createDisplayWaitTime(jsonSeconds, jsonTimestamp);
Expand Down

0 comments on commit 961da72

Please sign in to comment.