chores: updates
This commit is contained in:
@@ -13,11 +13,9 @@ let prices: Price[] = [
|
||||
];
|
||||
const official_dev = `https://dev.voce.chat`;
|
||||
const local_dev = `https://dev.voce.chat`;
|
||||
// const local_dev = `https://vocechat.yangerxiao.com`;
|
||||
// const local_dev = `http://localhost:3000`;
|
||||
const dev_origin = process.env.REACT_APP_OFFICIAL_DEMO ? official_dev : local_dev;
|
||||
|
||||
// const local_dev = `http://07333.qicp.vip:3030`;
|
||||
// const local_dev = `https://im.ttt.td`;
|
||||
export const BASE_ORIGIN = process.env.REACT_APP_RELEASE ? `${location.origin}` : dev_origin;
|
||||
export const IS_OFFICIAL_DEMO = BASE_ORIGIN === official_dev;
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
import { createSlice, PayloadAction } from "@reduxjs/toolkit";
|
||||
|
||||
// import BASE_URL from "../config";
|
||||
|
||||
export interface Favorite {
|
||||
id: string;
|
||||
created_at?: number;
|
||||
messages?: any[];
|
||||
}
|
||||
|
||||
const initialState: Favorite[] = [];
|
||||
|
||||
const favoritesSlice = createSlice({
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
import { createSlice, PayloadAction } from "@reduxjs/toolkit";
|
||||
|
||||
// import { ContentTypes } from "../config";
|
||||
// import { normalizeFileMessage } from "../../common/utils";
|
||||
// import { ContentType } from "@/types/message";
|
||||
import { Archive } from "@/types/resource";
|
||||
|
||||
export interface State {
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import { createSlice, PayloadAction } from "@reduxjs/toolkit";
|
||||
|
||||
import { ContentType } from "@/types/message";
|
||||
// import { ContentTypes } from "../config";
|
||||
import { normalizeFileMessage } from "@/utils";
|
||||
|
||||
export interface MessagePayload {
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { createSlice, PayloadAction } from "@reduxjs/toolkit";
|
||||
|
||||
import { Server } from "@/types/server";
|
||||
|
||||
export interface StoredServer extends Server {
|
||||
|
||||
@@ -162,7 +162,6 @@ const uiSlice = createSlice({
|
||||
currData = null;
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { createSlice, PayloadAction } from "@reduxjs/toolkit";
|
||||
import { ConnectionState } from "agora-rtc-sdk-ng";
|
||||
|
||||
import { ChatContext } from "@/types/common";
|
||||
import { KEY_UID } from "../config";
|
||||
import { resetAuthData } from "./auth.data";
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { FC } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
import { useAppSelector } from "@/app/store";
|
||||
import InviteLink from "../InviteLink";
|
||||
import MemberList from "./MemberList";
|
||||
|
||||
@@ -139,6 +139,6 @@ const Reply: FC<ReplyProps> = ({ mid, interactive = true, context, to = 0 }) =>
|
||||
);
|
||||
};
|
||||
|
||||
export default React.memo(Reply, (prevs, nexts) => {
|
||||
return prevs.mid == nexts.mid;
|
||||
export default React.memo(Reply, (prev, next) => {
|
||||
return prev.mid == next.mid;
|
||||
});
|
||||
|
||||
@@ -21,7 +21,6 @@ const RequireAuth: FC<Props> = ({ children, redirectTo = "/login" }) => {
|
||||
const { data: loginConfig, isSuccess: loginConfigSuccess } = useGetLoginConfigQuery();
|
||||
const { isLoading: checkingInitialized } = useGetInitializedQuery();
|
||||
const { token, guest, initialized } = useAppSelector((store) => store.authData);
|
||||
// console.log("auth route", { checkingInitialized, loginConfigSuccess, initialized, guest: loginConfig?.guest, token, allowGuest, guest });
|
||||
|
||||
// 初始化和login配置检查
|
||||
if (checkingInitialized || !loginConfigSuccess) return <Loading fullscreen={true} />;
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import { useEffect, useRef } from "react";
|
||||
|
||||
// import { useDebounce } from "rooks";
|
||||
|
||||
function useChatScroll<T extends HTMLElement>() {
|
||||
const ref = useRef<T>(null);
|
||||
useEffect(() => {
|
||||
|
||||
@@ -61,7 +61,6 @@ export default function useFavMessage({
|
||||
setFavorites(filtereds);
|
||||
}, [cid, uid, favs]);
|
||||
|
||||
// console.log("filtered", cid, uid, favs);
|
||||
return {
|
||||
isFavorited,
|
||||
addFavorite,
|
||||
|
||||
@@ -70,7 +70,6 @@ const useUploadFile = (props?: IProps) => {
|
||||
size: file_size
|
||||
} = file;
|
||||
console.log("file type", file_type);
|
||||
|
||||
// 生成 file id
|
||||
const resp = await prepareUploadFile({
|
||||
content_type: file_type,
|
||||
|
||||
@@ -5,6 +5,7 @@ import clsx from "clsx";
|
||||
import { useAppSelector } from "../../../app/store";
|
||||
import { ChatContext } from "../../../types/common";
|
||||
import getUnreadCount from "../utils";
|
||||
import { memo } from "react";
|
||||
|
||||
type Props = {
|
||||
context: ChatContext;
|
||||
@@ -48,4 +49,4 @@ const NewMessageBottomTip = ({ context, id, scrollToBottom }: Props) => {
|
||||
);
|
||||
};
|
||||
|
||||
export default NewMessageBottomTip;
|
||||
export default memo(NewMessageBottomTip);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// @ts-nocheck
|
||||
import { FC, useEffect, useState } from "react";
|
||||
import { FC, useEffect, useState, memo } from "react";
|
||||
import { useDrop } from "react-dnd";
|
||||
import { NativeTypes } from "react-dnd-html5-backend";
|
||||
import { NavLink, useMatch, useNavigate } from "react-router-dom";
|
||||
@@ -203,4 +203,6 @@ const Session: FC<IProps> = ({
|
||||
</li>
|
||||
);
|
||||
};
|
||||
export default Session;
|
||||
export default memo(Session, (prev, next) => {
|
||||
return prev.mid == next.mid;
|
||||
});
|
||||
|
||||
@@ -23,7 +23,7 @@ export default function DataManagement() {
|
||||
return (
|
||||
<div className="relative w-full md:w-[512px] flex flex-col gap-6">
|
||||
{/* 清除服务器聊天消息 */}
|
||||
<ServerVersionChecker version="0.3.12" empty={true}>
|
||||
<ServerVersionChecker version="0.3.10" empty={true}>
|
||||
<SettingBlock title={t("data.clear_msgs.title")} desc={t("data.clear_msgs.desc")}>
|
||||
<StyledButton onClick={handleModalVisible.bind(null, "chat")} className="danger">
|
||||
{t("data.clear_msgs.btn")}
|
||||
|
||||
Reference in New Issue
Block a user