MCPcopy Create free account
hub / github.com/FlowiseAI/Flowise / removeLocalStorageChatHistory

Function removeLocalStorageChatHistory

packages/ui/src/utils/genericHelper.js:912–928  ·  view source on GitHub ↗
(chatflowid)

Source from the content-addressed store, hash-verified

910}
911
912export const removeLocalStorageChatHistory = (chatflowid) => {
913 const chatDetails = localStorage.getItem(`${chatflowid}_INTERNAL`)
914 if (!chatDetails) return
915 try {
916 const parsedChatDetails = JSON.parse(chatDetails)
917 if (parsedChatDetails.lead) {
918 // Dont remove lead when chat is cleared
919 const obj = { lead: parsedChatDetails.lead }
920 localStorage.removeItem(`${chatflowid}_INTERNAL`)
921 localStorage.setItem(`${chatflowid}_INTERNAL`, JSON.stringify(obj))
922 } else {
923 localStorage.removeItem(`${chatflowid}_INTERNAL`)
924 }
925 } catch (e) {
926 return
927 }
928}
929
930export const unshiftFiles = (configData) => {
931 const filesConfig = configData.find((config) => config.name === 'files')

Callers 1

clearChatFunction · 0.90

Calls 2

stringifyMethod · 0.80
parseMethod · 0.65

Tested by

no test coverage detected