diff --git a/src/stores/AuthStore.js b/src/stores/AuthStore.js index 758a154..b98e1a7 100644 --- a/src/stores/AuthStore.js +++ b/src/stores/AuthStore.js @@ -138,13 +138,13 @@ const useAuthStore = create(devtools((set, get) => ({ }, loadUserSession: () => { - let sessionData = window.sessionStorage.getItem('GLOBAL_SALES_LOGIN_USER') + let sessionData = window.localStorage.getItem('GLOBAL_SALES_LOGIN_USER') - if (window.location.hostname === '202.103.68.93' && window.location.port === '4173' && isEmpty(sessionData)) { - sessionData = `{"userId":"383","userIdStr":"383,609","emailList":[{"opi_sn":383,"mat_sn":760,"email":"lyj@asiahighlights.com","default":false,"backup":false},{"opi_sn":383,"mat_sn":759,"email":"lyj@chinahighlights.com","default":true,"backup":false},{"opi_sn":383,"mat_sn":758,"email":"lyj@hainatravel.com","default":false,"backup":false}],"username":"廖一军","avatarUrl":"https://static-legacy.dingtalk.com/media/lALPBDDrhXr716HNAoDNAoA_640_640.png","mobile":"+86-18777396951","email":"lyj@hainatravel.com","whatsAppBusiness":"8617458471254","openId":"iioljiPmZ4RPoOYpkFiSn7IKAiEiE","accountList":[{"OPI_SN":383,"OPI_Code":"LYJ","OPI_NameCN":"廖一军","OPI_DEI_SN":7,"OPI_NameEN":"Jimmy Liow"},{"OPI_SN":609,"OPI_Code":"LYJAH","OPI_NameCN":"廖一军(ah)","OPI_DEI_SN":28,"OPI_NameEN":"Jimmy Liow"}]}` + // if (window.location.hostname === '202.103.68.93' && window.location.port === '4173' && isEmpty(sessionData)) { + // sessionData = `{"userId":"383","userIdStr":"383,609","emailList":[{"opi_sn":383,"mat_sn":760,"email":"lyj@asiahighlights.com","default":false,"backup":false},{"opi_sn":383,"mat_sn":759,"email":"lyj@chinahighlights.com","default":true,"backup":false},{"opi_sn":383,"mat_sn":758,"email":"lyj@hainatravel.com","default":false,"backup":false}],"username":"廖一军","avatarUrl":"https://static-legacy.dingtalk.com/media/lALPBDDrhXr716HNAoDNAoA_640_640.png","mobile":"+86-18777396951","email":"lyj@hainatravel.com","whatsAppBusiness":"8617458471254","openId":"iioljiPmZ4RPoOYpkFiSn7IKAiEiE","accountList":[{"OPI_SN":383,"OPI_Code":"LYJ","OPI_NameCN":"廖一军","OPI_DEI_SN":7,"OPI_NameEN":"Jimmy Liow"},{"OPI_SN":609,"OPI_Code":"LYJAH","OPI_NameCN":"廖一军(ah)","OPI_DEI_SN":28,"OPI_NameEN":"Jimmy Liow"}]}` - window.sessionStorage.setItem('GLOBAL_SALES_LOGIN_USER', sessionData) - } + // window.localStorage.setItem('GLOBAL_SALES_LOGIN_USER', sessionData) + // } if (import.meta.env.DEV && isEmpty(sessionData)) { sessionData = window.localStorage.getItem('GLOBAL_SALES_LOGIN_USER') } diff --git a/src/stores/ConversationStore.js b/src/stores/ConversationStore.js index 229856b..598fd1c 100644 --- a/src/stores/ConversationStore.js +++ b/src/stores/ConversationStore.js @@ -25,6 +25,7 @@ const conversationRow = { whatsapp_name: '', customer_name: '', whatsapp_phone_number: '', + top_state: 0, }; const initialConversationState = { diff --git a/src/views/Conversations/Online/Components/ChannelLogo.jsx b/src/views/Conversations/Online/Components/ChannelLogo.jsx index 7573dbd..0b9cfb2 100644 --- a/src/views/Conversations/Online/Components/ChannelLogo.jsx +++ b/src/views/Conversations/Online/Components/ChannelLogo.jsx @@ -7,7 +7,7 @@ const ChannelLogo = ({channel}) => { if (Array.isArray(channel)) { channel = channel[channel.length - 1]; } - const _channel = channel.toLowerCase(); + const _channel = (channel || '').toLowerCase(); switch (_channel) { case 'waba': return ; diff --git a/src/views/ReloadPrompt.jsx b/src/views/ReloadPrompt.jsx index acf2046..8e65aa4 100644 --- a/src/views/ReloadPrompt.jsx +++ b/src/views/ReloadPrompt.jsx @@ -34,7 +34,7 @@ function ReloadPrompt({ force }) { setInterval(() => { r.update(); - }, 1000 * 60 * 60 * 8); + }, 1000 * 60 * 60 * 1); }, 1000 * 3); }, onRegisterError(error) {