Merge remote-tracking branch 'upstream/main' into refactor/typescript
# Conflicts: # src/app/services/server.ts # src/common/component/GoogleLoginButton.tsx # src/common/utils.tsx
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import toast from "react-hot-toast";
|
||||
import { isObjectEqual } from "../utils";
|
||||
import { isEqual } from "lodash";
|
||||
import {
|
||||
useUpdateLoginConfigMutation,
|
||||
useUpdateSMTPConfigMutation,
|
||||
@@ -101,7 +101,7 @@ export default function useConfig(config = "smtp") {
|
||||
useEffect(() => {
|
||||
// 空对象
|
||||
if (Object.keys(values).length == 0) return;
|
||||
if (!isObjectEqual(originalValue, values)) {
|
||||
if (!isEqual(originalValue, values)) {
|
||||
setChanged(true);
|
||||
} else {
|
||||
setChanged(false);
|
||||
|
||||
@@ -65,7 +65,7 @@ export default function useMessageFeed({ context = "channel", id = null }) {
|
||||
}, [context, id]);
|
||||
useEffect(() => {
|
||||
if (items.length) {
|
||||
containerRef.current = document.querySelector(`#RUSTCHAT_FEED_${context}_${id}`);
|
||||
containerRef.current = document.querySelector(`#VOCECHAT_FEED_${context}_${id}`);
|
||||
if (containerRef.current) {
|
||||
const newScroll = containerRef.current.scrollHeight - containerRef.current.clientHeight;
|
||||
containerRef.current.scrollTop = curScrollPos + (newScroll - oldScroll);
|
||||
|
||||
@@ -219,7 +219,7 @@ export default function useStreaming() {
|
||||
const { gid, ...rest } = data;
|
||||
dispatch(
|
||||
updateChannel({
|
||||
id: gid,
|
||||
gid,
|
||||
...rest
|
||||
})
|
||||
);
|
||||
@@ -233,7 +233,7 @@ export default function useStreaming() {
|
||||
dispatch(
|
||||
updateChannel({
|
||||
operation: "add_member",
|
||||
id: gid,
|
||||
gid,
|
||||
members: uids
|
||||
})
|
||||
);
|
||||
@@ -242,13 +242,13 @@ export default function useStreaming() {
|
||||
case "user_leaved_group":
|
||||
{
|
||||
const { gid, uid: uids } = data;
|
||||
if (uids.findIndex((id) => id == loginUid) > -1) {
|
||||
if (uids.findIndex((uid) => uid == loginUid) > -1) {
|
||||
dispatch(removeChannel(gid));
|
||||
} else {
|
||||
dispatch(
|
||||
updateChannel({
|
||||
operation: "remove_member",
|
||||
id: gid,
|
||||
gid,
|
||||
members: uids
|
||||
})
|
||||
);
|
||||
|
||||
@@ -42,7 +42,7 @@ export default function useUploadFile(props: { context: string; id: string } | o
|
||||
if (!file) return;
|
||||
setData(null);
|
||||
const {
|
||||
name = `rustchat-${+new Date()}.${file.type.split("/")[1]}`,
|
||||
name = `-${+new Date()}.${file.type.split("/")[1]}`,
|
||||
type: file_type,
|
||||
size: file_size
|
||||
} = file;
|
||||
|
||||
Reference in New Issue
Block a user