@product7/product7-js 0.6.2 → 0.6.3
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.
package/dist/product7-js.js
CHANGED
|
@@ -11118,18 +11118,16 @@
|
|
|
11118
11118
|
const businessState = this.state.businessHoursState;
|
|
11119
11119
|
|
|
11120
11120
|
if (businessState === 'offline') {
|
|
11121
|
-
let offlineText =
|
|
11121
|
+
let offlineText = "We're currently closed";
|
|
11122
11122
|
if (this.state.holidayName) {
|
|
11123
11123
|
offlineText = `Closed for ${this.state.holidayName}`;
|
|
11124
11124
|
} else if (this.state.nextOpenAt) {
|
|
11125
11125
|
const opens = new Date(this.state.nextOpenAt);
|
|
11126
11126
|
const now = new Date();
|
|
11127
11127
|
const diffHours = Math.round((opens - now) / 3600000);
|
|
11128
|
-
|
|
11129
|
-
|
|
11130
|
-
|
|
11131
|
-
offlineText = `Opens ${opens.toLocaleDateString('en-US', { weekday: 'short', hour: 'numeric', hour12: true })}`;
|
|
11132
|
-
}
|
|
11128
|
+
offlineText = diffHours < 24
|
|
11129
|
+
? `Opens in ${diffHours}h`
|
|
11130
|
+
: `Opens ${opens.toLocaleDateString('en-US', { weekday: 'short', hour: 'numeric', hour12: true })}`;
|
|
11133
11131
|
}
|
|
11134
11132
|
return `
|
|
11135
11133
|
<div class="liveChat-home-availability">
|
|
@@ -11139,6 +11137,15 @@
|
|
|
11139
11137
|
`;
|
|
11140
11138
|
}
|
|
11141
11139
|
|
|
11140
|
+
if (businessState === 'away') {
|
|
11141
|
+
return `
|
|
11142
|
+
<div class="liveChat-home-availability">
|
|
11143
|
+
<span class="liveChat-availability-dot liveChat-availability-away"></span>
|
|
11144
|
+
<span class="liveChat-availability-text">${this.state.responseTime}</span>
|
|
11145
|
+
</div>
|
|
11146
|
+
`;
|
|
11147
|
+
}
|
|
11148
|
+
|
|
11142
11149
|
if (this.state.agentsOnline) {
|
|
11143
11150
|
return `
|
|
11144
11151
|
<div class="liveChat-home-availability">
|
|
@@ -12568,7 +12575,7 @@
|
|
|
12568
12575
|
this.LiveChatState.onlineCount = response.data.online_count || 0;
|
|
12569
12576
|
this.LiveChatState.responseTime = response.data.response_time || '';
|
|
12570
12577
|
|
|
12571
|
-
if (response.data.available_agents) {
|
|
12578
|
+
if (response.data.available_agents && this.LiveChatState.showAvatars !== false) {
|
|
12572
12579
|
this.LiveChatState.setTeamAvatarsFromAgents(
|
|
12573
12580
|
response.data.available_agents
|
|
12574
12581
|
);
|