mirror of
https://github.com/lux-tel/session-desktop.git
synced 2026-10-30 20:33:24 +00:00
17 lines
442 B
TypeScript
17 lines
442 B
TypeScript
import { createContext, useContext } from 'react';
|
|
|
|
export type ScrollToLoadedReasons =
|
|
| 'quote-or-search-result'
|
|
| 'go-to-bottom'
|
|
| 'unread-indicator'
|
|
| 'load-more-top'
|
|
| 'load-more-bottom';
|
|
|
|
export const ScrollToLoadedMessageContext = createContext(
|
|
(_loadedMessageIdToScrollTo: string, _reason: ScrollToLoadedReasons) => {}
|
|
);
|
|
|
|
export function useScrollToLoadedMessage() {
|
|
return useContext(ScrollToLoadedMessageContext);
|
|
}
|