File tree Expand file tree Collapse file tree 2 files changed +9
-11
lines changed
Expand file tree Collapse file tree 2 files changed +9
-11
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ import {
2020 round ,
2121 center ,
2222} from "@biseo/web/styles" ;
23- import { Megaphone , ChevronDown } from "lucide-react" ;
23+ import { Megaphone , ChevronUp } from "lucide-react" ;
2424
2525const Container = styled . div `
2626 position : relative;
@@ -60,7 +60,6 @@ export const ChatSection: React.FC = () => {
6060 const scrollRef = useRef < HTMLDivElement > ( null ) ;
6161
6262 useEffect ( ( ) => {
63- setShowLatest ( false ) ;
6463 scrollRef . current ?. scrollTo ( 0 , 0 ) ;
6564 if ( isNotice ) loadNotices ( ) . catch ( console . error ) ;
6665 else loadMore ( ) . catch ( console . error ) ;
@@ -89,14 +88,13 @@ export const ChatSection: React.FC = () => {
8988 const moreFlag = isNotice ? hasMoreNotices : hasMore ;
9089
9190 const handleRecentToggle = ( ) => {
92- if ( ! showLatest && notices . length === 0 ) {
93- loadNotices ( )
94- . then ( ( ) => {
95- if ( notices . length > 0 ) setShowLatest ( true ) ;
96- } )
97- . catch ( console . error ) ;
91+ if ( ! showLatest ) {
92+ setShowLatest ( true ) ;
93+ if ( notices . length === 0 ) {
94+ loadNotices ( ) . catch ( console . error ) ;
95+ }
9896 } else {
99- setShowLatest ( v => ! v ) ;
97+ setShowLatest ( false ) ;
10098 }
10199 } ;
102100
@@ -186,7 +184,7 @@ export const ChatSection: React.FC = () => {
186184 { notices [ 0 ] . message }
187185 </ p >
188186 </ div >
189- < ChevronDown
187+ < ChevronUp
190188 size = { 20 }
191189 color = { colors . gray500 }
192190 style = { { cursor : "pointer" } }
Original file line number Diff line number Diff line change @@ -171,7 +171,7 @@ const useChatStore = create(
171171 try {
172172 await socket . emitAsync ( "chat.update" , { id, type } ) ;
173173 } catch {
174- console . log ( Error ) ;
174+ console . log ( console . error ) ;
175175 }
176176 } ,
177177 } ) ) ,
You can’t perform that action at this time.
0 commit comments