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