diff --git a/src/common/component/ChannelModal/index.tsx b/src/common/component/ChannelModal/index.tsx index 838e162d..20c0312d 100644 --- a/src/common/component/ChannelModal/index.tsx +++ b/src/common/component/ChannelModal/index.tsx @@ -94,9 +94,9 @@ const ChannelModal: FC = ({ personal = false, closeModal }) => { return ( -
+
{!is_public && ( -
+
= ({ personal = false, closeModal }) => { />
{users && ( -
    +
      {users.map((u) => { const { uid } = u; const checked = members ? members.includes(uid) : false; @@ -134,19 +134,19 @@ const ChannelModal: FC = ({ personal = false, closeModal }) => { )}

      {t("create_channel")}

      -

      +

      {!is_public ? t("create_private_channel_desc") : t("create_channel_desc")}

      -
      +
      {t("channel_name")}
      -
      +
      {t("private_channel")} = ({ }) => { const fromUser = useAppSelector((store) => store.users.byId[from_uid]); const icon = getFileIcon(file_type, name, "icon w-9 h-12"); - if (!content || !fromUser || !name) return null; + if (!content || !name) return null; const previewContent = renderPreview({ file_type, content, name }); const withPreview = preview && previewContent; return (
      {icon} @@ -96,7 +96,7 @@ const FileBox: FC = ({ {formatBytes(size)} {fromNowTime(created_at)} - by {fromUser.name} + by {fromUser?.name || "Deleted User"}
      diff --git a/src/routes/chat/Layout/Operations.tsx b/src/routes/chat/Layout/Operations.tsx index 99360057..f9854bbd 100644 --- a/src/routes/chat/Layout/Operations.tsx +++ b/src/routes/chat/Layout/Operations.tsx @@ -55,7 +55,7 @@ const Operations: FC = ({ context, id }) => { }); const canDel = canDelete(mids); - const optClass = `p-2 bg-slate-100 rounded md:hover:bg-slate-300`; + const optClass = `p-2 bg-slate-100 dark:bg-slate-800 rounded md:hover:bg-slate-300 dark:md:hover:bg-slate-900`; return ( <>
      diff --git a/src/routes/chat/SessionList/index.tsx b/src/routes/chat/SessionList/index.tsx index 9cd0cb0b..19fcee08 100644 --- a/src/routes/chat/SessionList/index.tsx +++ b/src/routes/chat/SessionList/index.tsx @@ -37,7 +37,7 @@ const SessionList: FC = ({ tempSession }) => { if (!mids || mids.length == 0) { return { key: `channel_${id}`, unreads: 0, id, type: "channel" }; } - const mid = [...mids].pop(); + const mid = [...mids].sort().pop(); return { key: `channel_${id}`, id, mid, type: "channel" }; }); const uSessions = DMs.map((id) => { @@ -45,7 +45,7 @@ const SessionList: FC = ({ tempSession }) => { if (!mids || mids.length == 0) { return { key: `user_${id}`, unreads: 0, id, type: "user" }; } - const mid = [...mids].pop(); + const mid = [...mids].sort().pop(); return { key: `user_${id}`, type: "user", id, mid }; }); const tmps = [...(cSessions as ChatSession[]), ...(uSessions as ChatSession[])].sort((a, b) => { diff --git a/src/routes/chat/utils.tsx b/src/routes/chat/utils.tsx index f854dedf..f26ac9ef 100644 --- a/src/routes/chat/utils.tsx +++ b/src/routes/chat/utils.tsx @@ -96,7 +96,7 @@ const MessageWrapper = ({ selectMode = false, context, id, mid, children, ...res dispatch(updateSelectMessages({ context, id, operation, data: mid })); }; return ( -
      +
      {selectMode && } {children} {selectMode && ( diff --git a/src/routes/login/index.tsx b/src/routes/login/index.tsx index 3553acdb..6db43962 100644 --- a/src/routes/login/index.tsx +++ b/src/routes/login/index.tsx @@ -122,7 +122,7 @@ export default function LoginPage() { const hasDivider = enableMagicLink || googleLogin || enableMetamaskLogin || oidc.length > 0 || enableGithubLogin; - if (loadingSMTPStatus) return "Loading..."; + if (loadingSMTPStatus) return null; return (
      diff --git a/src/routes/resources/index.tsx b/src/routes/resources/index.tsx index 48ac48cc..8f402d87 100644 --- a/src/routes/resources/index.tsx +++ b/src/routes/resources/index.tsx @@ -38,11 +38,12 @@ let msnry: Masonry | null; function ResourceManagement({ fileMessages }) { const listContainerRef = useRef(); const [filter, setFilter] = useState({}); - const { message, view, channelMessage } = useAppSelector((store) => { + const { message, view, channelMessage, userData } = useAppSelector((store) => { return { message: store.message, channelMessage: store.channelMessage, - view: store.ui.fileListView + view: store.ui.fileListView, + userData: store.users.byId }; }); @@ -96,6 +97,8 @@ function ResourceManagement({ fileMessages }) { const data = message[id]; if (!data) return null; const isSelected = checkFilter(data, filter, channelMessage); + // 过滤掉不存在的用户 + // const fromUser = userData[data.from_uid]; if (!isSelected) return null; const { mid, content, created_at, from_uid, properties } = data; const { name, content_type, size } = properties ?? {}; diff --git a/src/routes/setting/BotConfig/WebhookEdit.tsx b/src/routes/setting/BotConfig/WebhookEdit.tsx index 170dd0ac..440feee5 100644 --- a/src/routes/setting/BotConfig/WebhookEdit.tsx +++ b/src/routes/setting/BotConfig/WebhookEdit.tsx @@ -72,7 +72,7 @@ const WebhookEdit = ({ uid }: Props) => { evt.preventDefault(); handleEdit(); }}> - +