From 70aadd5f2072ea8ae70488990facb81fb3143cb3 Mon Sep 17 00:00:00 2001
From: Zhang Minghan <zmh13054618081@dingtalk.com>
Date: Fri, 8 Mar 2024 09:35:55 +0800
Subject: [PATCH] fix: fix announcement

---
 app/src/conf/env.ts   | 2 ++
 app/src/store/chat.ts | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/app/src/conf/env.ts b/app/src/conf/env.ts
index 360fb245..ff239826 100644
--- a/app/src/conf/env.ts
+++ b/app/src/conf/env.ts
@@ -114,6 +114,8 @@ export function setAnnouncement(announcement: string): void {
   /**
    * set the announcement in localStorage
    */
+  if (!announcement || announcement.trim() === "") return;
+  
   const firstReceived = getMemory("announcement") !== announcement;
   setMemory("announcement", announcement);
 
diff --git a/app/src/store/chat.ts b/app/src/store/chat.ts
index 03d93c83..a0fc0302 100644
--- a/app/src/store/chat.ts
+++ b/app/src/store/chat.ts
@@ -633,7 +633,7 @@ export function useWorking(): boolean {
 
 export const updateMasks = async (dispatch: AppDispatch) => {
   const resp = await listMasks();
-  resp.data.length > 0 && dispatch(setCustomMasks(resp.data));
+  resp.data && resp.data.length > 0 && dispatch(setCustomMasks(resp.data));
 
   return resp;
 };