refactor: streamline data fetching in various hooks and components
Deploy to VPS / deploy (push) Successful in 2m39s
Deploy to VPS / deploy (push) Successful in 2m39s
This commit is contained in:
@@ -77,6 +77,11 @@ export function useMessages(
|
||||
}
|
||||
}, [cursor, loadingMore, guildId, channelId]);
|
||||
|
||||
// Auto-fetch when guildId/channelId changes
|
||||
useEffect(() => {
|
||||
fetch();
|
||||
}, [fetch]);
|
||||
|
||||
const prepend = useCallback((msg: MessageRecord) => {
|
||||
setMessages((prev) => [msg, ...prev]);
|
||||
}, []);
|
||||
|
||||
Reference in New Issue
Block a user