From 35529993896724dc2fdefbfc34c4167873a5ac9b Mon Sep 17 00:00:00 2001 From: Tristan Yang Date: Tue, 16 Jul 2024 22:36:04 +0800 Subject: [PATCH] chore: fixes --- src/app/slices/ui.ts | 9 ++++++++- src/components/FileBox/index.tsx | 9 ++------- src/components/FileMessage/DownloadArea.tsx | 2 +- src/components/Message/useMessageOperation.tsx | 5 ++++- src/routes/files/Filter/Channel.tsx | 8 +++++--- src/routes/files/Filter/From.tsx | 10 ++++++---- src/routes/files/index.tsx | 4 ++-- src/routes/resources/Filter/Channel.tsx | 8 +++++--- src/routes/resources/Filter/From.tsx | 10 ++++++---- 9 files changed, 39 insertions(+), 26 deletions(-) diff --git a/src/app/slices/ui.ts b/src/app/slices/ui.ts index 721b048b..5d98bc30 100644 --- a/src/app/slices/ui.ts +++ b/src/app/slices/ui.ts @@ -50,7 +50,14 @@ const uiSlice = createSlice({ initialState, reducers: { fillUI(state, action: PayloadAction>) { - const { SSEStatus, ready, online, msgSound = false, ...rest } = action.payload; + const { + SSEStatus, + ready, + online, + msgSound = false, + fileListView = "item", + ...rest + } = action.payload; window.MSG_SOUND = msgSound; return { ...state, msgSound, ...rest }; }, diff --git a/src/components/FileBox/index.tsx b/src/components/FileBox/index.tsx index ff3230da..08ccaff7 100644 --- a/src/components/FileBox/index.tsx +++ b/src/components/FileBox/index.tsx @@ -14,6 +14,7 @@ import { VideoPreview } from "./preview"; import { shallowEqual } from "react-redux"; +import DownloadArea from "../FileMessage/DownloadArea"; interface Data { file_type: string; @@ -135,13 +136,7 @@ const FileBox: FC = ({ - - - + {withPreview &&
{previewContent}
} diff --git a/src/components/FileMessage/DownloadArea.tsx b/src/components/FileMessage/DownloadArea.tsx index 9d972bc1..497a9074 100644 --- a/src/components/FileMessage/DownloadArea.tsx +++ b/src/components/FileMessage/DownloadArea.tsx @@ -10,7 +10,7 @@ type Props = { const DownloadArea = ({ copyLink, downloadLink }: Props) => { const { copy, copied } = useCopy(); return ( -
+