From 3fad71880765e27270774f71276917c9b966309e Mon Sep 17 00:00:00 2001 From: deeshu <99004662+deEshu2002@users.noreply.github.com> Date: Wed, 26 Apr 2023 19:27:01 +0530 Subject: [PATCH] fix: memo content availability for visitor mode (#1605) --- web/src/components/MemoContent.tsx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/web/src/components/MemoContent.tsx b/web/src/components/MemoContent.tsx index 05d99ab3..5f650ec4 100644 --- a/web/src/components/MemoContent.tsx +++ b/web/src/components/MemoContent.tsx @@ -32,7 +32,8 @@ const MemoContent: React.FC = (props: Props) => { //variable for auto-collapse const userStore = useUserStore(); - const { localSetting } = userStore.state.user as User; + const isVisitorMode = userStore.isVisitorMode(); + const autoCollapse: boolean = isVisitorMode ? true : (userStore.state.user as User).localSetting.enableAutoCollapse; useEffect(() => { if (showFull) { @@ -72,15 +73,13 @@ const MemoContent: React.FC = (props: Props) => {
{marked(content)}
- {localSetting.enableAutoCollapse && state.expandButtonStatus !== -1 && ( + {autoCollapse && state.expandButtonStatus !== -1 && (