@squiz/chat-ui
Advanced tools
Comparing version 1.3.0 to 1.4.0
# @squiz/chat-ui | ||
## 1.4.0 | ||
### Minor Changes | ||
- 10c3643: fix server side rendering issue | ||
## 1.3.0 | ||
@@ -4,0 +10,0 @@ |
@@ -49,11 +49,2 @@ "use strict"; | ||
}); | ||
const getSavedUserInputState = (sessionStorageId) => { | ||
const chatHistoryItem = sessionStorage.getItem(sessionStorageId); | ||
let isWaitingUserInput = false; | ||
if (chatHistoryItem) { | ||
const chatHistory = JSON.parse(chatHistoryItem); | ||
isWaitingUserInput = chatHistory.isWaitingUserInput; | ||
} | ||
return isWaitingUserInput; | ||
}; | ||
const ChatContextProvider = (props) => { | ||
@@ -65,3 +56,2 @@ const { aiId, aiApiUrl, aiService, isPreview, greeting, persistThread = false, children } = props; | ||
const [isWaitingResponse, setIsWaitingResponse] = (0, react_1.useState)(false); | ||
const [isWaitingUserInput, setIsWaitingUserInput] = (0, react_1.useState)(persistThread && getSavedUserInputState(sessionStorageId)); | ||
const [threadStartDate, setThreadStartDate] = (0, react_1.useState)(new Date()); | ||
@@ -71,2 +61,12 @@ const [conversation, setConversation] = (0, react_1.useState)([]); | ||
const [isProcessingRating, setIsProcessingRating] = (0, react_1.useState)(false); | ||
const getSavedUserInputState = (0, react_1.useCallback)(() => { | ||
const chatHistoryItem = sessionStorage.getItem(sessionStorageId); | ||
let isWaitingUserInput = false; | ||
if (chatHistoryItem) { | ||
const chatHistory = JSON.parse(chatHistoryItem); | ||
isWaitingUserInput = chatHistory.isWaitingUserInput; | ||
} | ||
return isWaitingUserInput; | ||
}, [sessionStorageId]); | ||
const [isWaitingUserInput, setIsWaitingUserInput] = (0, react_1.useState)(persistThread && getSavedUserInputState()); | ||
function getCommandExecutor() { | ||
@@ -193,3 +193,3 @@ if (executor.current !== null) { | ||
(0, react_1.useMemo)(() => { | ||
if (persistThread && isWaitingUserInput !== getSavedUserInputState(sessionStorageId)) { | ||
if (persistThread && isWaitingUserInput !== getSavedUserInputState()) { | ||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l0ZW06IHtcbiAgICAgICAgICAgICAgaWQ6IHV1aWR2NCgpLFxuICAgICAgICAgICAgICB0ZXh0OiAnWWVzJyxcbiAgICAgICAgICAgICAgc2VuZGVyOiAnVXNlcicsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgIH0sXG4gICAgICAgICAge1xuICAgICAgICAgICAgaW5zdHJ1Y3Rpb246ICdhZGQnLFxuICAgICAgICAgICAgaXRlbToge1xuICAgICAgICAgICAgICBpZDogdXVpZHY0KCksXG4gICAgICAgICAgICAgIHR5cGU6ICduZXdDaGF0QnJlYWsnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICB9LFxuICAgICAgICAgIHtcbiAgICAgICAgICAgIGluc3RydWN0aW9uOiAnYWRkJyxcbiAgICAgICAgICAgIGl0ZW06IHtcbiAgICAgICAgICAgICAgaWQ6IHV1aWR2NCgpLFxuICAgICAgICAgICAgICB0ZXh0OiBncmVldGluZyxcbiAgICAgICAgICAgICAgc2VuZGVyOiAnRnJvbnRlbmQnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICB9LFxuICAgICAgICAgIHtcbiAgICAgICAgICAgIGluc3RydWN0aW9uOiAncmVtb3ZlU2luZ2xlT2ZUeXBlJyxcbiAgICAgICAgICAgIGl0ZW06IHtcbiAgICAgICAgICAgICAgaWQ6IHV1aWR2NCgpLFxuICAgICAgICAgICAgICB0eXBlOiAnbmV3Q2hhdFJlcXVlc3QnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICB9LFxuICAgICAgICBdKTtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIHNldElzV2FpdGluZ1VzZXJJbnB1dChmYWxzZSk7XG4gICAgICAgIGFsdGVyQ29udmVyc2F0aW9uKFtcbiAgICAgICAgICB7XG4gICAgICAgICAgICBpbnN0cnVjdGlvbjogJ2FkZCcsXG4gICAgICAgICAgICBpdGVtOiB7XG4gICAgICAgICAgICAgIGlkOiB1dWlkdjQoKSxcbiAgICAgICAgICAgICAgdGV4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dGluZyhudWxsKTtcbiAgICAgICAgc2V0SXNQcm9jZXNzaW5nUmF0aW5nKGZhbHNlKTtcbiAgICAgICAgdXBkYXRlVGhyZWFkU2Vzc2lvblN0YXRlKHsgdGhyZWFkSWQ6IG51bGwsIHJhdGluZzogbnVsbCB9KTtcblxuICAgICAgICBhbHRlckNvbnZlcnNhdGlvbihbXG4gICAgICAgICAge1xuICAgICAgICAgICAgaW5zdHJ1Y3Rpb246ICdhZGQnLFxuICAgICAgICAgICAgaXRlbToge1xuICAgICAgICAgICAgICBpZDogdXVpZHY0KCksXG4gICAgICAgICAgICAgIHRleHQ6ICdZZXMnLFxuICAgICAgICAgICAgICBzZW5kZXI6ICdVc2VyJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgfSxcbiAgICAgICAgICB7XG4gICAgICAgICAgICBpbnN0cnVjdGlvbjogJ2FkZCcsXG4gICAgICAgICAgICBpdGVtOiB7XG4gICAgICAgICAgICAgIGlkOiB1dWlkdjQoKSxcbiAgICAgICAgICAgICAgdHlwZTogJ25ld0NoYXRCcmVhaycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgIH0sXG4gICAgICAgICAge1xuICAgICAgICAgICAgaW5zdHJ1Y3Rpb246ICdhZGQnLFxuICAgICAgICAgICAgaXRlbToge1xuICAgICAgICAgICAgICBpZDogdXVpZHY0KCksXG4gICAgICAgICAgICAgIHRleHQ6IGdyZWV0aW5nLFxuICAgICAgICAgICAgICBzZW5kZXI6ICdGcm9udGVuZCcsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgIH0sXG4gICAgICAgICAge1xuICAgICAgICAgICAgaW5zdHJ1Y3Rpb246ICdyZW1vdmVTaW5nbGVPZlR5cGUnLFxuICAgICAgICAgICAgaXRlbToge1xuICAgICAgICAgICAgICBpZDogdXVpZHY0KCksXG4gICAgICAgICAgICAgIHR5cGU6ICduZXdDaGF0UmVxdWVzdCcsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgIH0sXG4gICAgICAgIF0pO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgc2V0SXNXYWl0aW5nVXNlcklucHV0KGZhbHNlKTtcbiAgICAgICAgYWx0ZXJDb252ZXJzYXRpb24oW1xuICAgICAgICAgIHtcbiAgICAgICAgICAgIGluc3RydWN0aW9uOiAnYWRkJyxcbiAgICAgICAgICAgIGl0ZW06IHtcbiAgICAgICAgICAgICAgaWQ6IHV1aWR2NCgpLFxuICAgICAgICAgICAgICB0ZXh0OiAnTm8nLFxuICAgICAgICAgICAgICBzZW5kZXI6ICdVc2VyJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgfSxcbiAgICAgICAgICB7XG4gICAgICAgICAgICBpbnN0cnVjdGlvbjogJ2FkZCcsXG4gICAgICAgICAgICBpdGVtOiB7XG4gICAgICAgICAgICAgIGlkOiB1dWlkdjQoKSxcbiAgICAgICAgICAgICAgdGV4dDogJ09rLCBpcyB0aGVyZSBhbnl0aGluZyBlbHNlIEkgY2FuIGhlbHAgeW91IHdpdGg/JyxcbiAgICAgICAgICAgICAgc2VuZGVyOiAnRnJvbnRlbmQnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICB9LFxuICAgICAgICAgIHtcbiAgICAgICAgICAgIGluc3RydWN0aW9uOiAncmVtb3ZlU2luZ2xlT2ZUeXBlJyxcbiAgICAgICAgICAgIGl0ZW06IHtcbiAgICAgICAgICAgICAgaWQ6IHV1aWR2NCgpLFxuICAgICAgICAgICAgICB0eXBlOiAnbmV3Q2hhdFJlcXVlc3QnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICB9LFxuICAgICAgICBdKTtcbiAgICAgIH1cbiAgICB9LFxuICAgIFtncmVldGluZ10sXG4gICk7XG5cbiAgY29uc3QgaGFuZGxlT25SYXRlQ2hhdCA9IHVzZUNhbGxiYWNrKFxuICAgIGFzeW5jIChwb3NpdGl2ZVJhdGluZzogYm9vbGVhbikgPT4ge1xuICAgICAgaWYgKGR4cEFpQ2xpZW50LmN1cnJl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ZWQnKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH0sXG4gICAgW2FpSWQsIHRocmVhZFN0YXJ0RGF0ZSwgaXNQcm9jZXNzaW5nUmF0aW5nXSxcbiAgKTtcblxuICByZXR1cm4gKFxuICAgIDxDaGF0Q29udGV4dC5Qcm92aWRlclxuICAgICAgdmFsdWU9e3tcbiAgICAgICAgcmF0aW5nLFxuICAgICAgICBpc1Byb2Nlc3NpbmdSYXRpbmcsXG4gICAgICAgIGlzV2FpdGluZ1Jlc3BvbnNlLFxuICAgICAgICBpc1dhaXRpbmdVc2VySW5wdXQsXG4gICAgICAgIGNvbnZlcnNhdGlvbixcbiAgICAgICAgb25OZXdDaGF0UmVxdWVzdDogaGFuZGxlT25OZXdDaGF0UmVxdWVzdCxcbiAgICAgICAgb25OZXdDaGF0Q29uZmlybTogaGFuZGxlT25OZXdDaGF0Q29uZmlybSxcbiAgICAgICAgb25SYXRlQ2hhdDogaGFuZGxlT25SYXRlQ2hhdCxcbiAgICAgICAgb25TZW5kOiBoYW5kbGVPblNlbmQsXG4gICAgICB9fVxuICAgID5cbiAgICAgIHtjaGlsZHJlbn1cbiAgICA8L0NoYXRDb250ZXh0LlByb3ZpZGVyPlxuICApO1xufTtcbiJdfQ== |
{ | ||
"name": "@squiz/chat-ui", | ||
"version": "1.3.0", | ||
"version": "1.4.0", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "types": "dist/index.d.ts", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
688884
7258