|
|
|
@ -224,7 +224,7 @@ export const useEmailList = (mailboxDirNode) => {
|
|
|
|
|
}, [VKey])
|
|
|
|
|
|
|
|
|
|
const getMailList = useCallback(async () => {
|
|
|
|
|
console.log('getMailList', mailboxDirNode)
|
|
|
|
|
// console.log('getMailList', mailboxDirNode)
|
|
|
|
|
if (!opi_sn || !VKey || (!IsTrue && !COLI_SN)) {
|
|
|
|
|
setMailList([])
|
|
|
|
|
setLoading(false)
|
|
|
|
@ -261,7 +261,7 @@ export const useEmailList = (mailboxDirNode) => {
|
|
|
|
|
getMailList()
|
|
|
|
|
// --- Setup Internal Event Listener ---
|
|
|
|
|
const handleInternalUpdate = (event) => {
|
|
|
|
|
console.log(`[useEmailList] Received internal event. `, event.detail)
|
|
|
|
|
// console.log(`[useEmailList] Received internal event. `, event.detail)
|
|
|
|
|
if (event.detail && event.detail.type === 'listrow') {
|
|
|
|
|
loadMailListFromCache()
|
|
|
|
|
}
|
|
|
|
@ -271,7 +271,7 @@ export const useEmailList = (mailboxDirNode) => {
|
|
|
|
|
// --- Setup BroadcastChannel Listener ---
|
|
|
|
|
const channel = getEmailChangesChannel()
|
|
|
|
|
const handleMessage = (event) => {
|
|
|
|
|
console.log(`[useEmailList] Received channel event. `, event.data)
|
|
|
|
|
// console.log(`[useEmailList] Received channel event. `, event.data)
|
|
|
|
|
const cacheKey = isEmpty(COLI_SN) ? `dir-${VKey}` : `order-${VKey}`
|
|
|
|
|
if (event.data.type === 'listrow' && cacheKey === event.data.listKey) {
|
|
|
|
|
// cacheKey 不相同时, 不需要更新; 邮箱目录不相同
|
|
|
|
|