diff --git a/src/app/services/base.query.js b/src/app/services/base.query.js index 2fa1609f..72717f41 100644 --- a/src/app/services/base.query.js +++ b/src/app/services/base.query.js @@ -54,7 +54,6 @@ const baseQueryWithTokenCheck = async (args, api, extraOptions) => { ); result = await waitingForRenew; waitingForRenew = null; - // console.log({ refreshResult }); if (result.data) { // store the new token api.dispatch(updateToken(result.data)); diff --git a/src/app/slices/message.user.js b/src/app/slices/message.user.js index b0111bdd..e8cd193b 100644 --- a/src/app/slices/message.user.js +++ b/src/app/slices/message.user.js @@ -15,9 +15,13 @@ const userMsgSlice = createSlice({ state.byId = action.payload; }, addUserMsg(state, action) { - const { id, mid } = action.payload; + const { id, mid, local_id } = action.payload; if (state.byId[id]) { - if (state.byId[id].findIndex((id) => id == mid) > -1) return; + const midExsited = state.byId[id].findIndex((id) => id == mid) > -1; + const localMsgExsited = + state.byId[id].findIndex((id) => id == local_id) > -1; + if (midExsited || localMsgExsited) return; + state.byId[id].push(+mid); } else { state.byId[id] = [+mid]; @@ -28,7 +32,10 @@ const userMsgSlice = createSlice({ const { id, mid } = action.payload; if (state.byId[id]) { const idx = state.byId[id].findIndex((i) => i == mid); - state.byId[id].splice(idx, 1); + if (idx > -1) { + // 存在 则再删除 + state.byId[id].splice(idx, 1); + } } }, }, diff --git a/src/common/component/ChannelSetting/DeleteConfirmModal.js b/src/common/component/ChannelSetting/DeleteConfirmModal.js index 3bc2e59d..ab26de91 100644 --- a/src/common/component/ChannelSetting/DeleteConfirmModal.js +++ b/src/common/component/ChannelSetting/DeleteConfirmModal.js @@ -39,7 +39,7 @@ export default function DeleteConfirmModal({ id, closeModal }) { } - className="animate__animated animate__fadeInDown animate__faster" + // className="animate__animated animate__fadeInDown animate__faster" > ); diff --git a/src/common/component/Message/DeleteMessageConfirm.js b/src/common/component/Message/DeleteMessageConfirm.js index 60392b38..f6532c1c 100644 --- a/src/common/component/Message/DeleteMessageConfirm.js +++ b/src/common/component/Message/DeleteMessageConfirm.js @@ -25,7 +25,7 @@ export default function DeleteMessageConfirmModal({ closeModal, mid = 0 }) { return ( diff --git a/src/common/component/Setting/LogoutConfirmModal.js b/src/common/component/Setting/LogoutConfirmModal.js index ba0e69b1..fc057ca0 100644 --- a/src/common/component/Setting/LogoutConfirmModal.js +++ b/src/common/component/Setting/LogoutConfirmModal.js @@ -63,7 +63,7 @@ export default function LogoutConfirmModal({ closeModal }) { } - className="animate__animated animate__fadeInDown animate__faster" + // className="animate__animated animate__fadeInDown animate__faster" >