@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/package.json
CHANGED
|
@@ -1059,7 +1059,7 @@ export class LiveChatWidget extends BaseWidget {
|
|
|
1059
1059
|
this.LiveChatState.onlineCount = response.data.online_count || 0;
|
|
1060
1060
|
this.LiveChatState.responseTime = response.data.response_time || '';
|
|
1061
1061
|
|
|
1062
|
-
if (response.data.available_agents) {
|
|
1062
|
+
if (response.data.available_agents && this.LiveChatState.showAvatars !== false) {
|
|
1063
1063
|
this.LiveChatState.setTeamAvatarsFromAgents(
|
|
1064
1064
|
response.data.available_agents
|
|
1065
1065
|
);
|
|
@@ -81,18 +81,16 @@
|
|
|
81
81
|
const businessState = this.state.businessHoursState;
|
|
82
82
|
|
|
83
83
|
if (businessState === 'offline') {
|
|
84
|
-
let offlineText =
|
|
84
|
+
let offlineText = "We're currently closed";
|
|
85
85
|
if (this.state.holidayName) {
|
|
86
86
|
offlineText = `Closed for ${this.state.holidayName}`;
|
|
87
87
|
} else if (this.state.nextOpenAt) {
|
|
88
88
|
const opens = new Date(this.state.nextOpenAt);
|
|
89
89
|
const now = new Date();
|
|
90
90
|
const diffHours = Math.round((opens - now) / 3600000);
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
offlineText = `Opens ${opens.toLocaleDateString('en-US', { weekday: 'short', hour: 'numeric', hour12: true })}`;
|
|
95
|
-
}
|
|
91
|
+
offlineText = diffHours < 24
|
|
92
|
+
? `Opens in ${diffHours}h`
|
|
93
|
+
: `Opens ${opens.toLocaleDateString('en-US', { weekday: 'short', hour: 'numeric', hour12: true })}`;
|
|
96
94
|
}
|
|
97
95
|
return `
|
|
98
96
|
<div class="liveChat-home-availability">
|
|
@@ -102,6 +100,15 @@
|
|
|
102
100
|
`;
|
|
103
101
|
}
|
|
104
102
|
|
|
103
|
+
if (businessState === 'away') {
|
|
104
|
+
return `
|
|
105
|
+
<div class="liveChat-home-availability">
|
|
106
|
+
<span class="liveChat-availability-dot liveChat-availability-away"></span>
|
|
107
|
+
<span class="liveChat-availability-text">${this.state.responseTime}</span>
|
|
108
|
+
</div>
|
|
109
|
+
`;
|
|
110
|
+
}
|
|
111
|
+
|
|
105
112
|
if (this.state.agentsOnline) {
|
|
106
113
|
return `
|
|
107
114
|
<div class="liveChat-home-availability">
|