feat: message reply

This commit is contained in:
zerosoul
2022-03-08 21:46:11 +08:00
parent f35fd765f0
commit 4e77c4ba79
20 changed files with 221 additions and 80 deletions
+2
View File
@@ -113,9 +113,11 @@ export default function ChannelChat({
unread,
removed = false,
edited,
reply,
} = msg;
return (
<Message
reply={reply}
edited={edited}
likes={likes}
removed={removed}
+2
View File
@@ -86,9 +86,11 @@ export default function DMChat({ uid = "", dropFiles = [] }) {
pending = false,
removed = false,
edited,
reply,
} = msg;
return (
<Message
reply={reply}
likes={likes}
edited={edited}
removed={removed}
+1 -1
View File
@@ -43,7 +43,7 @@ export default function HomePage() {
<div className={`col left ${menuExpand ? "expand" : ""}`}>
<ServerDropList
data={data?.server}
memberCount={data?.metrics?.user_count}
memberCount={data.contacts?.length}
expand={menuExpand}
/>
<nav className="nav">
+4 -23
View File
@@ -7,10 +7,7 @@ import { clearAuthData, setUserData } from "../../app/slices/auth.data";
import { setContacts } from "../../app/slices/contacts";
// import { useGetChannelsQuery } from "../../app/services/channel";
import {
useLazyGetServerQuery,
useLazyGetMetricsQuery,
} from "../../app/services/server";
import { useLazyGetServerQuery } from "../../app/services/server";
import { KEY_UID } from "../../app/config";
// pollingInterval: 0,
// const querySetting = {
@@ -39,15 +36,6 @@ export default function usePreload() {
data: server,
},
] = useLazyGetServerQuery();
const [
getMetrics,
{
isLoading: metricsLoading,
isSuccess: metricsSuccess,
isError: metricsError,
data: metrics,
},
] = useLazyGetMetricsQuery();
useEffect(() => {
initCache();
rehydrate();
@@ -55,7 +43,6 @@ export default function usePreload() {
useEffect(() => {
getContacts();
getServer();
getMetrics();
}, []);
useEffect(() => {
@@ -77,18 +64,12 @@ export default function usePreload() {
}
}, [contacts]);
return {
loading:
contactsLoading ||
serverLoading ||
metricsLoading ||
!checked ||
!cacheFirst,
error: contactsError && serverError && metricsError,
success: contactsSuccess && serverSuccess && metricsSuccess,
loading: contactsLoading || serverLoading || !checked || !cacheFirst,
error: contactsError && serverError,
success: contactsSuccess && serverSuccess,
data: {
contacts,
server,
metrics,
},
};
}