1
0
mirror of https://github.com/tooot-app/app synced 2025-06-05 22:19:13 +02:00

MVP last read position

This commit is contained in:
Zhiyuan Zheng
2022-01-16 23:26:05 +01:00
parent 0b4a8ead84
commit 9a41dd2191
20 changed files with 446 additions and 87 deletions

View File

@ -60,11 +60,9 @@ const AttachmentVideo: React.FC<Props> = ({
const appState = useRef(AppState.currentState)
useEffect(() => {
AppState.addEventListener('change', _handleAppStateChange)
const appState = AppState.addEventListener('change', _handleAppStateChange)
return () => {
AppState.removeEventListener('change', _handleAppStateChange)
}
return () => appState.remove()
}, [])
const _handleAppStateChange = async (nextAppState: AppStateStatus) => {
if (appState.current.match(/active/) && nextAppState.match(/inactive/)) {