refactor: replace isLoading with isSuccess

This commit is contained in:
Tristan Yang
2022-12-14 16:47:01 +08:00
parent 50e839c001
commit 703ea8716c
5 changed files with 8 additions and 8 deletions
+1 -1
View File
@@ -23,7 +23,7 @@ export const onMessageSendStarted = async (
if (type == "archive") return;
// id: who send to ,from_uid: who sent
// console.log("handlers data", content, type, properties, ignoreLocal, id);
const isMedia = ["image", "video", "audio"].includes(properties.content_type.split('/')[0]);
const isMedia = properties.content_type ? ["image", "video", "audio"].includes(properties.content_type.split('/')[0]) : false;
// const isImage = properties.content_type?.startsWith("image");
const ts = properties.local_id || +new Date();
const tmpMsg = {
-2
View File
@@ -28,11 +28,9 @@ export const userApi = createApi({
});
},
async onQueryStarted(data, { dispatch, queryFulfilled }) {
// const local_uid = Number(localStorage.getItem(KEY_UID));
try {
const { data: users } = await queryFulfilled;
dispatch(fillUsers(users));
// }
} catch {
console.log("get user list error");
}